Here is how I manage to download all videos of specific course from http://coursera.org. Even counrsera-downloader Chrome extension sucks. I would rather do it from command-line.
- nodejs
- shelljs (
npm install -g shelljs
)
-
The following script to be run in 'all videos' page of http://coursera.org course, would copy all video links with their titles as JSON to clipboard.
var videos = Array.prototype.slice.call(document.querySelectorAll('a[title="Video (MP4)"]'),0); var out = vidoes.map(function(video) { return {link:video.href, title: video.querySelector('div').innerHTML.replace(/ /g, '_') + '.mp4'}; }); copy(out);
Then save the clipboard data as
videos.json
file. -
Export http://coursera.org cookies after logging in using cookietxt-export chrome extension.
-
Download all videos in
videos.json
having the cookies incookies.txt
with the following script:require('shelljs/global'); var videos = require('./videos.json'); videos.forEach(function(video) { console.log('downloading ',video.link); exec('wget --load-cookies cookies.txt ' + video.link+' -O "' + video.title + '"'); });