// ==UserScript== // @name Video Game Music batch downloader // @name:zh-TW Video Game Music 批量下載器 // @namespace http://tampermonkey.net/ // @version 0.1 // @description batch download for downloads.khinsider.com originalsoundtracks // @description:zh-TW 批量下載 downloads.khinsider.com 的原聲帶 // @author maple3142 // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js // @match https://downloads.khinsider.com/game-soundtracks/album/* // @grant GM_xmlhttpRequest // @connect 66.90.93.122 // @downloadURL none // ==/UserScript== (function() { 'use strict' function downloadblob(url){ return new Promise((resolve,reject)=>{ GM_xmlhttpRequest({ method: 'GET', url, responseType: 'blob', onload: res=>resolve(res.response) }) }) } function download(link,name){ GM_xmlhttpRequest({ method: 'GET', url: link, responseType: 'blob', onload(res){ const url=URL.createObjectURL(res.response) const a=document.createElement('a') a.download=name a.href=url document.body.appendChild(a) a.click() a.remove() } }) } $('a:contains("click to download")').on('click',e=>{ e.preventDefault() $('.albumMassDownload').append(`