Skip to content

Instantly share code, notes, and snippets.

@Abhinav1217
Last active July 12, 2020 23:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Abhinav1217/4c368bf940b9e9bdf8f3a802c50436e4 to your computer and use it in GitHub Desktop.
Save Abhinav1217/4c368bf940b9e9bdf8f3a802c50436e4 to your computer and use it in GitHub Desktop.
youtube-dl aliases for stuffs
# Some youtube-dl shortcuts and workarounds.
# Download MP3
alias youtube-dl-mp3="youtube-dl --extract-audio --audio-format mp3 "
# Youtube playlist which is organised in folders and Videos are numbered.
# use youtube-dl-playlist -f 22 <link>
alias youtube-dl-playlist='youtube-dl -o "./%(playlist_title)s/%(playlist_index)s_%(title)s.%(ext)s" '
# Youtube-dl to download from hotstar.
# There is a current bug because of which, it does not download a single video but a full playlist.
# hotstar playlist is in reverse order and Highest quality is Very large filesize. 720 is watchable enough.
alias youtube-dl-hotstar='youtube-dl --playlist-reverse -o "%(autonumber)s-%(title)s.%(ext)s" -f "bestvideo[height<=720]+bestaudio/best[height<=720]" '
# use -f "bestvideo[height<=720]+bestaudio/best[height<=720]" for 720p without worring about hsl-xxxx numbering in hotstar and brightcove videos.
# Download Video Courses from Udemy in an organized way.
# You would need udemy account, Its username and password. You can also only download courses which you bought.
alias youtube-dl-udemy='youtube-dl -u "<UdemyUsername>" -p "<UdemyPassword>" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s" -k --write-auto-sub --cookies "cookies.txt" '
# Use browser extension to copy cookies as a text file. Udemy needs a cookie file for this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment