Skip to content

Instantly share code, notes, and snippets.

@tdr2d
Last active January 2, 2020 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdr2d/7bd7c3a7edc5a555172517b26aaca9b0 to your computer and use it in GitHub Desktop.
Save tdr2d/7bd7c3a7edc5a555172517b26aaca9b0 to your computer and use it in GitHub Desktop.
Youtube-dl, Udemy-dl cheat code
#!/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