Created
November 18, 2016 09:28
-
-
Save kaeff/7f3be2e262747719e6d195d968ca6bbf to your computer and use it in GitHub Desktop.
Download an egghead.io lesson using youtube-dl
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
#!/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