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
@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