Skip to content

Instantly share code, notes, and snippets.

@kaeff
Created November 18, 2016 09:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaeff/7f3be2e262747719e6d195d968ca6bbf to your computer and use it in GitHub Desktop.
Save kaeff/7f3be2e262747719e6d195d968ca6bbf to your computer and use it in GitHub Desktop.
Download an egghead.io lesson using youtube-dl
#!/bin/bash
# Usage: dl-lession.sh https://egghead.io/courses/react-fundamentals
let n=1
for link in $(curl -s $1 | pup '.series-lessons-list a attr{href}'); do
filename=$(echo $link | sed "s/https:\/\/egghead.io\/lessons\///g" | sed "s/\?.*$//g")
filename_numbered=$(echo "$n $filename" | awk '{ printf "%02i-%s.mp4\n", $1, $2 }')
youtube-dl -o "$filename_numbered" "$link"
let n++
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment