Skip to content

Instantly share code, notes, and snippets.

@wlib
Last active August 17, 2020 18:49
Show Gist options
  • Save wlib/cce00bee274347ca29375f0279603e00 to your computer and use it in GitHub Desktop.
Save wlib/cce00bee274347ca29375f0279603e00 to your computer and use it in GitHub Desktop.
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