您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
adds a link that triggers buy for $0; set format to FLAC and click download.
当前为
// ==UserScript== // @name BC: do free downloads // @namespace userscript1 // @match https://*.bandcamp.com/* // @match https://*.bandcamp.com/* // @match https://bandcamp.com/download // @grant none // @version 0.2.1 // @author - // @license GPLv3 // @description adds a link that triggers buy for $0; set format to FLAC and click download. // ==/UserScript== (function() { 'use strict'; const emailaddress = ''; // put your email here function $(s) { return document.querySelector(s); } // release page ------------------------------------- function startFreeDownload() { $('button.buy-link').click(); setTimeout(function() { var elm = $('#userPrice'); elm.value='0'; var event = new UIEvent("change", { "view": window, "bubbles": true, "cancelable": true }); elm.dispatchEvent(event); }, 300); setTimeout(function() { $('.download-panel-free-download-link').click(); }, 1000); setTimeout(function() { if ($('#downloadButtons_download').style.display != 'none') { console.log('email not required, clicking OK'); $('#downloadButtons_download button.download-panel-checkout-button').click(); } else { console.log('email required'); $('#fan_email_postalcode').value = '1'; $('#fan_email_address').focus(); if (emailaddress) { $('#fan_email_address').value = emailaddress; $('#downloadButtons_download button.download-panel-checkout-button').click(); } } }, 1500); } var elm = $('#trackInfoInner'); if (elm && elm.textContent.includes('name your price') ) { $('li.buyItem').insertAdjacentHTML( 'beforeEnd', '<h4><a id="StartFreeDownload">Start free download >></a></h4>' ); $('#StartFreeDownload').addEventListener('click', startFreeDownload); } // end release page ------------------------------------- // download page ------------------------------------- function downloadWhenReady() { var link = $('span.download-title a.item-button'); if (link && link.style.display != 'none' && link.textContent.includes('Download') ) { console.log('clicking download'); link.click(); } else { console.log('waiting for download'); setTimeout(downloadWhenReady, 1000); } } elm = $('div.item-format'); if (elm && !elm.textContent.includes('FLAC') ) { setTimeout(function() { elm.click(); $('.formats > li:nth-child(3)').click(); }, 500); } if (elm) { setTimeout(downloadWhenReady, 2000); } // end download page ------------------------------------- })();