Python script using the Youtube-API and youtube-dl to download and keep track of your Youtube favorites
If you want to keep a backup copy of your favorite videos, it is quite inconvinient to download them manually and to keep track of which videos are new and which you already have saved. This simple script can automate this task for you.
- Python 3.5+
- youtube-dl
- Youtube/Google-Account
- Clone this repo
git clone [email protected]:n0ctua/yt-favs.git
- Create and activate an isolated Python environment
python3 -m venv ./venv source venv/bin/activate
- Install requirements
pip install --upgrade -r requirements.txt
- Setup Credentials
- Visit your Google API Console
- Create a new project, e.g. yt-favs
- In the library panel, find and enable the
YouTube Data API v3
for this project - In the credentials panel, create an
OAuth 2.0 client ID
and set the application type toTVs and Limited Input devices
- Download the JSON file that contains your OAuth 2.0 credentials, rename it to
client_secret.json
and move it to the project directory - When you run the script for the first time, your browser will open and you have to grant this app the permission to access your Youtube account. You can always check which third-party apps can access your Google account here.
source venv/bin/activate
python3 yt-favs.py