Skip to content

Instantly share code, notes, and snippets.

@ldong
Last active December 7, 2023 16:16
Show Gist options
  • Save ldong/b289d56090f98d02423c to your computer and use it in GitHub Desktop.
Save ldong/b289d56090f98d02423c to your computer and use it in GitHub Desktop.
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});

You will get the following list

https://egghead.io/lessons/react-building-a-react-js-app-notetaker-introduction
https://egghead.io/lessons/react-building-a-react-js-app-up-and-running-with-react-and-webpack
https://egghead.io/lessons/react-building-a-react-js-app-basic-routing-with-react-router
https://egghead.io/lessons/react-building-a-react-js-app-state-props-and-thinking-in-react
https://egghead.io/lessons/react-building-a-react-js-app-component-validation-with-proptypes
https://egghead.io/lessons/react-building-a-react-js-app-using-reactfire-to-add-data-persistence
https://egghead.io/lessons/react-building-a-react-js-app-managing-state-in-child-components
https://egghead.io/lessons/react-building-a-react-js-app-transitions-with-react-router
https://egghead.io/lessons/react-building-a-react-js-app-making-server-requests-in-react-with-axios
https://egghead.io/lessons/react-building-a-react-js-app-rendering-a-ui-of-dynamic-data
https://egghead.io/lessons/react-building-a-react-js-app-componentwillreceiveprops-and-react-router
https://egghead.io/lessons/react-building-a-react-js-app-es6-refactor-non-components
https://egghead.io/lessons/react-building-a-react-js-app-es6-refactor-createclass-to-javascript-classes-and-proptypes
https://egghead.io/lessons/react-building-a-react-js-app-es6-refactor-proptypes-in-es6
https://egghead.io/lessons/react-building-a-react-js-app-es6-refactor-routing-without-mixins
https://egghead.io/lessons/react-building-a-react-js-app-es6-refactor-firebase-and-react-binding-with-re-base

Steps:

  1. Save as list.txt

  2. brew install youtube-dl

  3. youtube-dl -a list.txt

Run this rename script to get rid of the Mojibake

for i in *mp4; do
   mv "$i" "`echo $i | sed "s/#.*//"`"'.mp4';
done
@Y-Taras
Copy link

Y-Taras commented Oct 7, 2017

@Shivamkrjha
Here's a screenshot with error from that particular video that you've mentioned:
screenshot from 2017-10-07 08 37 15
What am I doing wrong?..

@Nithanaroy
Copy link

@npasparuhov
Copy link

@Shivamkrjha this method works for free videos so what about the PRO contect any idea how to get them?

@azdanov
Copy link

azdanov commented Dec 4, 2017

youtube-dl -cio '%(autonumber)s-%(title)s.%(ext)s' -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' https://egghead.io/courses/the-beginner-s-guide-to-reactjs --restrict-filenames

To download a course with best video/audio quality and a format of 00001-Introduction_to_The_Beginner_s_Guide_to_ReactJS.mp4

@gopiborra
Copy link

@azdanov, Thanks!

@janaka120
Copy link

Downloaded separate audio file & video file. So, would you please tell me how to resolve this issue.

Thanks.

@abhishek-nigam
Copy link

@azdanov, Thanks, buddy!

@zeenfaizpy
Copy link

@janaka120 install ffmpeg and then try it agian.

In mac, brew install ffmpeg

@corysimmons
Copy link

Thank you @azdanov 🏄‍♂️

@tuanluu-agilityio
Copy link

tuanluu-agilityio commented Dec 5, 2017

On MacOS:

brew install youtube-dl
youtube-dl https://egghead.io/courses/the-beginner-s-guide-to-reactjs

Note: youtube-dl just download courses FREE not PRO.

It's work fine for me. Thanks!

@ufthelp
Copy link

ufthelp commented Dec 5, 2017

3 easy steps for MacOS:

1. brew install youtube-dl

2. brew install ffmpeg

Note: Without installing ffmpeg, youtube-dl will download separate audio file & video file.

3. youtube-dl <video-url>

@uiyuvi
Copy link

uiyuvi commented Dec 8, 2017

How to download https://d2c5owlt6rorc3.cloudfront.net/build-a-toggle-component-294eac7226/build-a-toggle-component-294eac7226.m3u8 with audio.. I have tried may attempts stills getting only vieo or only audio... i couldn't get to download audio+video together

@kevinsmithwebdev-zz
Copy link

@shivamkr19 - thank you. It's inelegant, but it works. Maybe it's the best we can do for now.

@amrdraz
Copy link

amrdraz commented Jan 9, 2018

I noticed that you can download the entire series by visiting while loggedin

`https://egghead.io/api/v1/series/${series_name}`

Example: https://egghead.io/api/v1/series/advanced-react-component-patterns

You should get something like this

{
  "id":166,
  "duration":4306,
  "title":"Advanced React Component Patterns",
  "slug":"advanced-react-component-patterns",
  "state":"published",
  ...,
  "lessons_url":"https://egghead.io/api/v1/series/advanced-react-component-patterns/lessons",
  "download_url":"https://egghead.io/api/v1/series/advanced-react-component-patterns/download?key=[token_is_here]",
  ...
  }

Copy the value of the download_url key and open it in the browser.
This will download the entire series as a zip file.

the zip file tends to be pretty big though, but then you could always go through each lesson and call the download_url for that lesson

or write a script that does that XD

@Leyart
Copy link

Leyart commented May 15, 2018

using the APIs to download the zip is definitely working for me and it is an elegant and quick solution, thanks

@eaorak
Copy link

eaorak commented Jun 19, 2018

@amrdraz, it works, thanks 👍

@eaorak
Copy link

eaorak commented Jun 20, 2018

I've created a simple project to download egghead videos by using the approach suggested by @amrdraz. It works fine atm. It uses Puppeteer to log in and call the egghead api. Comments and contributions are more than welcome.

https://github.com/eaorak/egghead-downloader

@cuylerstuwe
Copy link

cuylerstuwe commented Jul 2, 2018

I wrote a short userscript a couple months ago which allows Pro users to download videos or courses from the browser by appending #dl to the end of the URL.

It uses the API routes that @amrdraz found.

To install it, you need to have a userscript management extension added to your browser (I recommend Tampermonkey), then you click the Raw button in the Gist. The extension will recognize the URL pattern and prompt you to install:

https://gist.github.com/salembeats/4044adc4eeb708b25c705444e45dc55b

@goldnetonline
Copy link

I use this to get the video links, August 2018

console.clear()
var links = ""
$("a[data-click-handler=true]").each(function(ind , elem) {
    if(elem.href.match(/^https:\/\/egghead.io\/lessons/) ) 
		links += elem.href + "\n"; 
})
console.clear()
links

@cumibulat
Copy link

@goldnetonline how to use your script ?

@Akshay090
Copy link

Akshay090 commented Oct 8, 2018

Just go to the Course page and paste the link in console
@cumibulat

@Gyvastis
Copy link

Gyvastis commented Oct 8, 2018

Should this suppose to work for premium content as well?

@a-eid
Copy link

a-eid commented Oct 26, 2018

this is a programatic way of doing what is described above, it's very basic
I might add to it later

https://github.com/a-eid/egghead-basic-downloader

@peebeebee
Copy link

copy([...new Set(Array.from(document.querySelectorAll('[href^="/lessons"]')).map(a => a.href))].join('\n'))

@ijasxyz
Copy link

ijasxyz commented Apr 1, 2019

copy([...new Set(Array.from(document.querySelectorAll('[href^="/lessons"]')).map(a => a.href))].join('\n'))

Add a '/' after lessons to ignore /lessons link,

copy([...new Set(Array.from(document.querySelectorAll('[href^="/lessons/"]')).map(a => a.href))].join('\n'))

@saeedafroozi
Copy link

I have read all the comments but still I could not download anythings.I will appreciate if some helps me to download some videos

@ashleyconnor
Copy link

Protected content can be downloaded via the --add-header= flag. Courses already have a download button but Collections do not.

youtube-dl -a playlist.txt --add-header=Cookie:"ahoy_visitor=...."

@bchenSyd
Copy link

I have read all the comments but still I could not download anythings.I will appreciate if some helps me to download some videos

I did got those links by following instructions above, but youtube-dl gave me "URL not supported error"

so far I'm only able to download these links, which is pretty useless

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