Skip to content

Instantly share code, notes, and snippets.

@shivamkr19
Last active February 4, 2022 09:48
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save shivamkr19/1b964f64bfe04d9d54e0668c6223b765 to your computer and use it in GitHub Desktop.
Save shivamkr19/1b964f64bfe04d9d54e0668c6223b765 to your computer and use it in GitHub Desktop.
Download free egghead.io videos

Download free egghead.io videos

Download Egghead.io videos using Lynx Browser and youtube-dl. This method will only work for videos that do not require a pro account.

Prerequesits

You need a Unix/Linux box with Lynx console browser and Youtube-dl installed.

Lynx console Browser

Installation on Ubuntu(may require sudo)

$ apt-get install lynx

Installation on Fedora(may require sudo)

$ yum install lynx

Installation on Mac OS X(using homebrew)

$ brew install lynx

For all other Operating Systems, use your default package manager.

Youtube-dl

Official installation docs
https://rg3.github.io/youtube-dl/download.html
EDIT: Since HLS videos are segmented into many small parts and youtube-dl requires ffmpeg to convert videos, you also need ffmpeg as written on this page.

Downloading Video files

The following example should work for Linux and Mac.

$ url=https://egghead.io/courses/leverage-new-features-of-react-16
  • Use the below command to download all videos for a course or a given specific lesson depending on the URL you provided in last step.
# Old script had a lot of issues on os such as freeBSD and mac
# New script is as below : 
$ lynx -source $url | grep -o -e 'https://[^"]*.m3u8' | xargs -n1 youtube-dl -o "%(title)s.%(ext)s"

# You can also use CURL instead of lynx browser as in below script
$ curl -L $url | grep -o -e 'https://[^"]*.m3u8' | xargs -n1 youtube-dl -o "%(title)s.%(ext)s"

UPDATE: Doesn't work on Mac as pointed out in the comments by @toddzebert and others. Try solutions from Nithanaroy and mutalis instead.

@phcostabh
Copy link

This snippet works on Mac and keep the files in order, prefixing them with "0x-", where x is the number of the episode. 😉

curl -sL $url \
    | grep -o -e 'https://[^"]*.m3u8' \
    | cat -n \
    | while read number file; do youtube-dl -o "$(printf "%02d" $number)-%(title)s.%(ext)s" $file; done

Copy link

ghost commented Jul 5, 2018

How to redownload course? I cannot redownload after canceled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment