(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