This script is to help get metadata out of YouTube Channels and Playlists. It's a WIP, but can be immediately useful.
- To extract video URLs, titles, and descriptions from a YouTube playlist using Python, you can use the google-api-python-client library. Here's a step-by-step guide on how to do this:
Install the google-api-python-client library:
pip install google-api-python-client environs pydantic python-frontmatter python-slugify rich typer
- Get an API key for the YouTube Data API:
- Go to the Google Cloud Console: https://console.cloud.google.com/
- Create a new project or select an existing one.
- Click on "Enable APIs and Services" and search for "YouTube Data API v3".
- Click "Enable" to enable the API for your project.
- Click "Create credentials" and follow the steps to get an API key.
- To use it:
export YOUTUBE_API_KEY=YOUR-API-KEY-HERE
python youtube-to-frontmatter.py --playlist=PL2NFhrDSOxgUoF-4F2MdAFvOK1wOrNdqB
PRs are welcome at https://github.com/jefftriplett/youtube-to-frontmatter.
Linting should be verified by running just lint
. There are currently no tests, so just test
is expected to fail.
In addition to the development supporting packages that will be installed by just
, you may need to install the following:
- just
- pre-commit
pip install pre-commit
Here are a few ways to keep up with me online. If you have a question about this project, please consider opening a GitHub Issue.