EmbyCrackedClient/web/modules/multidownload.js

1 line
467 B
JavaScript
Raw Normal View History

2025-06-25 11:46:04 +08:00
function sameDomain(url){var a=document.createElement("a");return a.href=url,location.hostname===a.hostname&&location.protocol===a.protocol}function download(url){var a=document.createElement("a");a.download="",a.href=url,a.dispatchEvent(new MouseEvent("click"))}export default function(urls){if(!urls)throw new Error("`urls` required");let delay=0;urls.forEach(function(url){if(!sameDomain(url))return setTimeout(download.bind(null,url),100*++delay);download(url)})}