Skip to content

Instantly share code, notes, and snippets.

@Miladiir Miladiir/youtube.sh
Last active Jun 29, 2017

Embed
What would you like to do?
Download a playlist from Youtube
#!/bin/sh
# Download all Youtube videos in a playlist into a folder. Video information gets stored into a json.
# Works best with public playlists, like favorites, series playlists, etcs.
# Example: I use this exact setup to download my favorites dayly.
# Whats nice about this is that already existing videos dont get downloaded again, that all the information
# gets preserved and that I will be able to watch videos that get listed as private forever.
# Destination dir
DIR=$HOME/youtube/
# Playlist url
URL=https://www.youtube.com/playlist?list=FLCmq7I4GnxicNZbwK_j6JCQ
# Start of Script
cd $DIR
date > last-run.log
youtube-dl --id --no-part --write-info-json --no-cache-dir --ignore-errors $URL >> last-run.log 2>&1
cd - >/dev/null
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.