This repo contains two scripts:
- A Google Apps Script that reads additions to a Google Sheet and adds corresponding YouTube videos to a playlist.
- A Python scrip that polls a YouTube playlist for videos, downloads the videos, and deletes them from the playlist.
See README.md
# Create virtual environment
virtualenv scroogeroke
# Change default python to virtual one
source scroogeroke/bin/activate
# install the Google APIs Client Library for Python
pip install --upgrade google-api-python-client
# install the google-auth-oauthlib and google-auth-httplib2 libraries for user authorization.
pip install --upgrade google-auth-oauthlib google-auth-httplib2
# install yt-dlp
python3 -m pip install -U yt-dlp
Follow the Youtube Data API Python Quickstart instructions
to generate credentials. Copy the credentials file to the root and name it YOUR_CLIENT_SECRET_FILE.json
.
Create two environment variables.
# The ID of the youtube playlist that you want to poll
export YOUTUBE_PLAYLIST_ID=<your_youtube_playlist_id>
# The location that you want your videos to download to
export YOUTUBE_DOWNLOAD_DIR=<your_download_dir>
# Change default python to virtual one
source scroogeroke/bin/activate
# run the file
python scheduler.py