SailHe / egghead-video-download

:floppy_disk: Introduction how to download Egghead videos for offline view

Home Page:https://www.npmjs.com/package/get-links-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

egghead-logo

Egghead Video Download

Quick Introduction how to Download Egghead Videos for Offline View.

Please remember that these guys make a great job and invest lots of time to provide these useful information. That said consider to support them for their great work and Sign Up for a free account, follow them on Twitter, share their content or whatever ... I'm traveling and the Hotel internet sucks hard, so i share this infos for others with slow and anoying internet connections.

Update:

I wrote a small npm module to automate this task: get-links-cli.

Example Usage:

# Installation
npm install -g get-links-cli

# Collect Links
get-links -u https://videourl-here.tld -c ".playlist-lessons-list a" -o list.txt

# Download Videos
youtube-dl -i -o "%(autonumber)s-%(title)s.%(ext)s" -a list.txt

Installation

Youtube Downloader

https://github.com/rg3/youtube-dl

brew install youtube-dl

Get Links

Javascript Code

Solution 1: Collect all links and copy them direct to the clipboard.

Execute the snippet and past it into a Textfile to download later via the Youtube Downloader.

let a=[];document.querySelectorAll('.playlist-lessons-list a').forEach(l => a.push(l.href));copy(a.join('\n'));

Info: Clipboard support may not work with every Browser: http://caniuse.com/#feat=clipboard.

Solution 2: Print the collected links to the console via console.dir

document.querySelectorAll('.playlist-lessons-list a').forEach(l => console.dir(l.href))

上述语句已失效, 使用:
var playlist = []; document.querySelectorAll('li a.flex').forEach(l => {if(l.children[1].children[1].children.length < 3) playlist.push(l.href); else console.log('锁住的:' + l.href); });
var lockPlaylist = []; document.querySelectorAll('li .flex.mr2').forEach(l => {console.log(l.parentElement.parentElement.parentElement.href);});
copy(playlist.join('\n'));

// 结果直接存在与剪切板

The tip to use console.dir() came from tucq88 who run in some issues with to long URL's which Chrome shorten via "...".

Info: console.dir is not an official standard yet it may or may not work in your current Browser.

Solution 3: Collect the links and print the Array Object

let a=[];document.querySelectorAll('.playlist-lessons-list a').forEach(l => a.push(l.href));console.log(a);

Solution 4: Print collected links via console.log

document.querySelectorAll('.playlist-lessons-list a').forEach(link => console.log(link.href))

This was the original solution but can cause problems with too long URL's which the Browser shorten between with "...".

Save the collected links in a Textfile list.txt and run:

Download

youtube-dl -i -o "%(autonumber)s-%(title)s.%(ext)s" -a list.txt

Download for Pro-User

This Tip comes from torfeld6

Download Pro content without clicking through the whole playlist:

youtube-dl -i -o "%(autonumber)s-%(title)s.%(ext)s" -a list.txt --cookie ../cookies.txt

The cookies.txt can be downloaded via https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg

I don't have a Pro Account yet so i can't test it

Contact / Social Media

Get the latest News about Web Development, Open Source, Tooling, Server & Security

GithubDockernpmTwitterFacebookGoogle+Gitter

License

Creative Commons License

This work by Maik Ellerbrock is licensed under a Creative Commons Attribution 4.0 International License.

About

:floppy_disk: Introduction how to download Egghead videos for offline view

https://www.npmjs.com/package/get-links-cli