Skip to content

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

License

Notifications You must be signed in to change notification settings

klairvoyance/yt-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published