// ==UserScript== // @name Khinsider AntiRedirect // @namespace https://downloads.khinsider.com/game-soundtracks/* // @version 0.5 // @description Makes khinsider stop redirecting you when clicking download on a soundtrack. Also directly downloads the soundtracks instead of redirecting and includes a right click save as directly from the album's page. // @author realcoloride // @license MIT // @match https://downloads.khinsider.com/game-soundtracks/* // @icon https://www.google.com/s2/favicons?sz=64&domain=khinsider.com // @connect vgmdownloads.com // @connect vgmsite.com // @connect vgmtreasurechest.com // @grant GM.xmlHttpRequest // @downloadURL https://update.greasyfork.icu/scripts/465151/Khinsider%20AntiRedirect.user.js // @updateURL https://update.greasyfork.icu/scripts/465151/Khinsider%20AntiRedirect.meta.js // ==/UserScript== (function() { const FLAC_DOWNLOAD_COLOR = "#2bb7c7"; const songlist = document.getElementById('songlist'); let pass = true; let tbody; try { tbody = songlist.getElementsByTagName("tbody")[0]; } catch (error) {pass = false;} if (!pass) return; const songElements = tbody.getElementsByTagName("tr"); const excludedElements = [ 'songlist_header', 'songlist_footer' ] function extractUrl(htmlString) { const regex = / { if (xhr.readyState == 4 && xhr.status == 200) { const body = xhr.response; const url = extractUrl(body); finish(url); hrefElement.remove(); } else console.log('Something errored with the request'); } } injectStyles(); for (let i = 0; i < songElements.length; i++) { const trackElement = songElements[i]; let passing = true; for (let j = 0; j < excludedElements.length; j++) { if (excludedElements[j] == trackElement.id) passing = false; } if (passing) inject(trackElement); } })();