Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 2.29 KB

README.md

File metadata and controls

78 lines (59 loc) · 2.29 KB

yt-metadata

A command-line tool to fetch metadata using the YouTube Data API.

Current Features

  • Fetches video details such as title, duration, and filename from multiple videos in a playlist.
  • Saves metadata as a CSV file for easy analysis.
  • [Intended to expand functionalities]

Prerequisites

  1. Python 3.6 or higher: Verify your Python version
    python --version
  2. YouTube Data API Credentials (free service):

Installation

  1. Clone the repository:
    git clone https://github.com/klairvoyance/yt-metadata.git
  2. Navigate to the project directory:
    cd yt-metadata
  3. Install dependencies from the requirements.txt file:
    pip install -r requirements.txt

Docker Usage (Optional)

You can also run this tool via Docker:

  1. Build the Docker image:
    docker build -t yt-metadata .
  2. Run the Docker container:
    docker run yt-metadata <playlist_id>

Setup

  • Go to the Google Developer Console.
  • ... (TODO: trailing-'/')

Usage

1. Authenticate

Ensure your client_secret.json is in the project directory. You will be prompted to authenticate each time you run the script!

2. Fetch Playlist Metadata

Run the script using:

python main.py <playlist_id>

Replace <playlist_id> with the ID of the YouTube playlist.

Example:

python main.py PLbpi6ZahtOH41pTffYAcobNPYveptjT5K

This will generate a CSV file named after the playlist title containing metadata for each video.

Notes

  • Ensure the client_secret.json file is kept secure and is not uploaded to public repositories.
  • The CSV file will be saved in the current working directory.

License

This project is licensed under the GNU General Public License v3.0. Feel free to use, modify, and distribute the code for personal and commercial purposes.