Python script to download YouTube videos from your Watch Later Playlist
youtube-dl-watch-later-playlist.py
is a python script to automatically download all the first 100 YouTube videos from your current Watch Later Playlist. The script will start Chromedriver
and login to your Google Account.
Logging in to your Google Account is currently done by signing up at stackoverflow.com
via Google, since logging in to Google directly at YouTube won't work due to Google not trusting automated Webbrowsers like Chromedriver
. The workaround works, since stackoverflow.com
is one of the trusted apps by Google.
The script also works when your Google Account has Two-Factor Authentication
activated and will wait for 5 minutes before throwing a TimeoutException.
After successfully logging in to Google and being redirected to stackoverflow.com
, Chromedriver
will move to https://www.youtube.com/playlist?list=WL
and crawl the links for all the videos in the playlist and the script will start downloading them with youtube-dl
.
- Colored Terminal output with termcolor
To get a local copy up and running follow these simple steps.
- Python 3
# Install via brew on macOS
brew install python
For Linux and Windows refer to this.
- Chromedriver
brew cask install chromedriver
For Linux and Windows refer to this.
- youtube-dl
brew install youtube-dl
For Linux and Windows refer to this.
1: Fork the repository (using the Fork
button at the top)
2: Clone the repository
# Replace {YOUR_USERNAME} with your actual username
git clone https://github.com/{YOUR_USERNAME}/youtube-dl-watch-later-playlist.git
3: Change directory to youtube-dl-watch-later-playlist
cd youtube-dl-watch-later-playlist
4: Install python requirements
pip3 install -r requirements.txt
- Start the download script
python3 youtube-dl-watch-later-playlist.py
- The script will prompt you for your
google username
and yourgoogle password
- After your input, the script will start an automated Chrome browser with Selenium and sign up to
stackoverflow.com
with your Google credentials. - If you entered wrong credentials you will be prompted for them again in your Terminal.
- You can change the download folder for the videos in line 11:
download_folder = '~/Downloads/'
- Open Issue: Will only download the first 100 entries of your Watch Later Playlist
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Workaround for Google Login issue - 'This browser or app may not be secure'
- youtube-dl