Skip to content

Instantly share code, notes, and snippets.

@dima1034
Forked from punchouty/pluralsight.js
Created April 30, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dima1034/979e757d7f5dafb3e957dee49f565bbd to your computer and use it in GitHub Desktop.
Save dima1034/979e757d7f5dafb3e957dee49f565bbd to your computer and use it in GitHub Desktop.
Pluralsight Video Download
//Login to pluralsight in chrome and Open a course you want to download
//Example - https://app.pluralsight.com/library/courses/aws-automating-cloudformation/table-of-contents
//Click on "Start" or "Resume Course" Button
//chapter listing
var list = document.getElementsByTagName("section");
var counter=0;
for (var i=0; i<list.length; i++) {
if ( list[i].className.match(/\bmodule\b/) ) {
var header_text = list[i].getElementsByTagName("h2")[0].innerText;
var ul = list[i].getElementsByClassName('clips');
var li_list = ul[0].getElementsByClassName('title');
if ( li_list.length > 0 ) {
console.log("------" + header_text + "------");
for (var y=0; y<li_list.length; y++) {
counter += 1;
console.log(counter + " - " + li_list[y].innerText); // chapter listing
}
console.log(" ");
console.log(" ");
}
}
}
// function to down load video
function downloadVideo(uri, name) {
var link = document.createElement("a");
link.download = name;
link.href = uri;
link.click();
}
//RUN above in chrome "console"
// Download current playing video
downloadVideo(document.getElementsByTagName('video')[0].src, "overview.mp4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment