Greasy Fork

Greasy Fork is available in English.

Bandcamp: I'm Not A Fan

Removes playback limitation and dialog "The time has come to open thy heart/wallet"

当前为 2022-01-28 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name                  Bandcamp: I'm Not A Fan
// @name:ru               Bandcamp: Я не фанат
// @description           Removes playback limitation and dialog "The time has come to open thy heart/wallet"
// @description:ru        Снимает ограничение воспроизведений и убирает диалог "Пришло время открыть свое сердце/кошелек"
// @namespace             bc-inotafan.user.js
// @version               1.0.2
// @license               MIT
// @author                askornot
// @icon                  https://s4.bcbits.com/img/favicon/safari-pinned-tab.svg
// @match                 https://*.bandcamp.com/*
// @homepageURL           http://greasyfork.icu/ru/scripts/438039-bandcamp-i-m-not-a-fan
// @supportURL            http://greasyfork.icu/ru/scripts/438039-bandcamp-i-m-not-a-fan/feedback
// @grant                 unsafeWindow
// @run-at                document-end
// @compatible            chrome  Violentmonkey 2.13.0
// @compatible            firefox Tampermonkey 4.13.6136
// ==/UserScript==

'use strict';

const W = unsafeWindow || window;

const player = W.Player;
if (player === undefined) return;

const proxy = (target, index, fn) => {
  target = new Proxy(target, {
    apply(...args) {
      fn(args[index]);
      return Reflect.apply(...args);
    },
  });
};

const target = 'copy';
const proto = player.TrackInfo.prototype;
const uncap = (o) => (o.is_capped = false);

proxy(proto[target], 1, uncap);

const tralbum = W.TralbumData;
if (tralbum === undefined) return;

const value = Object.freeze({
  streaming_limits_enabled: false,
  streaming_limit: Infinity,
});

Object.defineProperty(tralbum, 'play_cap_data', {
  configurable: false,
  enumerable: true,
  writable: false,
  value,
});