-
-
Save dedsm/1993413 to your computer and use it in GitHub Desktop.
Download Coursera videos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
$('a.lecture-link').each(function (index){ | |
var $lectureLink = $(this); | |
var videoLink = $lectureLink.attr('href').replace('view','download.mp4'); | |
var subtitleLink = $lectureLink.attr('href').trim().replace('view','subtitles').replace('lecture_id', 'q') + "_en"; | |
var videoName = '\"' + (index+1) + '.' + $lectureLink.text().trim() + '.mp4\"'; | |
var subtitleName = '\"' + (index+1) + '.' + $lectureLink.text().trim() + '.srt\"'; | |
var cookieHeader = ' --header \"Cookie:'+ document.cookie + '\" '; | |
console.log('curl -L' + cookieHeader + videoLink + ' > ' + videoName); | |
console.log('curl -L' + cookieHeader + subtitleLink + ' > ' + subtitleName); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I expanded this code into a bookmarklet.