Last active
August 17, 2020 18:49
-
-
Save wlib/cce00bee274347ca29375f0279603e00 to your computer and use it in GitHub Desktop.
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
const https = require("https") | |
const pageHTMLHandler = html => { | |
const videoURL = html.match(/https:\/\/vidstreaming\.io\/load\.php\?id=.*?SUB/)[0] | |
require("child_process").exec(`open "${videoURL}"`) | |
} | |
const requestHandler = HTMLHandler => response => { | |
let html = "" | |
response.on("data", chunk => html += chunk) | |
response.on("end", () => HTMLHandler(html)) | |
} | |
const getEpisode = episode => | |
https.get(`https://www8.gogoanimehub.tv/gintama-episode-${episode}`, requestHandler(pageHTMLHandler)) | |
getEpisode(parseInt(process.argv[2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment