Last active
January 2, 2020 16:41
-
-
Save tdr2d/7bd7c3a7edc5a555172517b26aaca9b0 to your computer and use it in GitHub Desktop.
Youtube-dl, Udemy-dl cheat code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
### Youtube | |
URLS=( | |
"https://www.youtube.com/watch?v=YbH1E2R9TOM" | |
"https://www.youtube.com/watch?v=fdNYW23Vm_c" | |
"https://www.youtube.com/watch?v=gh0faLFKl3w" | |
"https://www.youtube.com/watch?v=Homukj0sBYU" | |
"https://www.youtube.com/watch?v=tRxPLnXgVdE" | |
"https://www.youtube.com/watch?v=FxpvD0gfb0U" | |
) | |
for url in "${URLS[@]}"; do | |
youtube-dl -i --yes-playlist -x --audio-format mp3 --audio-quality 1 --embed-thumbnail --add-metadata $url | |
done | |
### Udemy | |
# Download cookies.txt using this chrome extension | |
# https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg | |
# Write the slugs of the course when you are on the udemy course page | |
# https://www.udemy.com/course/[slug here]/... | |
SLUGS=( | |
"seo-roadmap" | |
"the-ultimate-google-adwords-training-course" | |
) | |
for slug in "${SLUGS[@]}"; do | |
youtube-dl --cookies cookies.txt \ | |
-o "$slug/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s" \ | |
"https://www.udemy.com/$slug" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment