A command-line tool to fetch metadata using the YouTube Data API.
- 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]
- Python 3.6 or higher: Verify your Python version
python --version
- YouTube Data API Credentials (free service):
- Create a
client_secret.json
file by following the YouTube API Guide. - For a detailed setup guide, refer to the Setup section
- Create a
- Clone the repository:
git clone https://github.com/klairvoyance/yt-metadata.git
- Navigate to the project directory:
cd yt-metadata
- Install dependencies from the
requirements.txt
file:pip install -r requirements.txt
You can also run this tool via Docker:
- Build the Docker image:
docker build -t yt-metadata .
- Run the Docker container:
docker run yt-metadata <playlist_id>
- Go to the Google Developer Console.
- ... (TODO: trailing-'/')
Ensure your client_secret.json
is in the project directory. You will be prompted to authenticate each time you run the script!
Run the script using:
python main.py <playlist_id>
Replace <playlist_id>
with the ID of the YouTube playlist.
python main.py PLbpi6ZahtOH41pTffYAcobNPYveptjT5K
This will generate a CSV file named after the playlist title containing metadata for each video.
- 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.
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.