Skip to content

Instantly share code, notes, and snippets.

@lsimone
Created October 22, 2017 21:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsimone/4a334aca1a97ec41e56f42daf35e8cc6 to your computer and use it in GitHub Desktop.
Save lsimone/4a334aca1a97ec41e56f42daf35e8cc6 to your computer and use it in GitHub Desktop.
Download free egghead.io videos
#!/bin/bash
list=`lynx -source $1 | grep -o -e 'https[^"]*.m3u8' | xargs`
course="${1##*/}"
mkdir $course
echo ">>> $(echo $list | wc -w) video(s) found"
c=1
for video in $list
do
echo ">>> DOWNLOADING: $( printf "%02d" $c ) - $video"
youtube-dl $video -o "$course/$( printf "%02d" $c ) - %(title)s.%(ext)s"
let c+=1
done
@dotBits
Copy link

dotBits commented Oct 29, 2017

suggestion: replace lynx with curl to have less dependencies

@npasparuhov
Copy link

it works ok but only for free content and not for paid courses

@gitKearney
Copy link

I'm getting the following error

>>>        1 video(s) found
>>> DOWNLOADING: 01 - https://d2c5owlt6rorc3.cloudfront.net/javascript-redux-the-single-immutable-state-tree-c6a3d339f0/javascript-redux-the-single-immutable-state-tree-c6a3d339f0.m3u8
[generic] javascript-redux-the-single-immutable-state-tree-c6a3d339f0: Requesting header
[generic] javascript-redux-the-single-immutable-state-tree-c6a3d339f0: Downloading m3u8 information
[download] Destination: react-redux-the-single-immutable-state-tree/01 - javascript-redux-the-single-immutable-state-tree-c6a3d339f0.f599.mp4
avconv version 12.2, Copyright (c) 2000-2017 the Libav developers
  built on Oct  1 2017 01:28:28 with Apple LLVM version 9.0.0 (clang-900.0.37)
https://d2c5owlt6rorc3.cloudfront.net/javascript-redux-the-single-immutable-state-tree-c6a3d339f0/video_720p_javascript-redux-the-single-immutable-state-tree-c6a3d339f0.m3u8: Protocol not found


ERROR: ffmpeg exited with code 1

I have lynx, ffmpeg, and youtube-dl installed

@mnxoid
Copy link

mnxoid commented Mar 20, 2018

Thanks a lot. Works as a charm on Ubuntu 16.04 as of 03/20/2018

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