-
-
Save 4ft35t/c44a4736cd6f854dcc464205b9cad681 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(function() { | |
function escapeQuote(str) { | |
return str.replace("\"", "\\\""); | |
} | |
function buildAria2Url(name, url) { | |
return `aria2c -c -s10 -k1M -x16 --enable-rpc=false ` + | |
`-o "${escapeQuote(name)}" ` + | |
`--header "${escapeQuote(window.navigator.userAgent)}" ` + | |
`--header "Referer: ${escapeQuote(window.location.toString())}" ` + | |
`--header "Cookie: ${escapeQuote(window.document.cookie)}" ` + | |
`"${escapeQuote(url)}"`; | |
} | |
const id = Math.random().toString(36).substring(7); | |
webpackJsonp([2], { | |
[id]: function(m, e, r) { | |
const lookupWYFunction = function(name) { | |
return Object.values(r.c).map((x) => x.exports).filter((x) => x[name] !== undefined); | |
}; | |
const list = document.querySelector(".list-group-bd").__vue__.selectedList; | |
const getSingleUrl = lookupWYFunction("getSingleUrl")[0].getSingleUrl; | |
list.map(node => { | |
getSingleUrl(node).then(data => { | |
console.log(buildAria2Url(node.getName(), data.https_download_url)); | |
}, error => { | |
console.warn(error); | |
}); | |
}); | |
} | |
}, [id]); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment