Skip to content

Instantly share code, notes, and snippets.

@seeya
Created July 22, 2018 11:40
Show Gist options
  • Save seeya/9f703dc26df5a5cdafd8d14f92b9ad38 to your computer and use it in GitHub Desktop.
Save seeya/9f703dc26df5a5cdafd8d14f92b9ad38 to your computer and use it in GitHub Desktop.
Maplestage link extractor
// parallel download - https://github.com/fd0/machma
// dailymotion downloader - https://github.com/soimort/you-get
// Save the extracted links in a file
$("option").each(function() {
let base = "http://maplestage.com";
let link = $(this).attr("value");
$.get(`${base}${link}`,function(data) {
let title = $(data).find("option:selected").text().replace(" ", "");
let id = data.split(`"name":"dailymotion","videos":[{"id":"`)[1].split(`"`)[0];
console.log(`https://www.dailymotion.com/video/${id}#name=${title}`);
})
});
// Pipe it into a terminal
cat links.txt | machma -p 10 -- you-get {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment