Speechify Premium Voices Helper

Removes 1500 word limit on premium voices

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Speechify Premium Voices Helper
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Removes 1500 word limit on premium voices
// @author       You
// @match        https://app.speechify.com/*
// @match        https://dev.app.speechify.com/*
// @match        https://staging.app.speechify.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=speechify.com
// @grant        unsafeWindow
// @run-at       document-start
// @license      MIT
// ==/UserScript==

const mockedResponse = {
    "subscriptions": [
        {
            "id": "someId",
            "status": "active",
            "renewalStatus": "active",
            "plan": {
                "name": "google_play",
                "price": 0,
                "renewalFrequency": "annually",
                "conversionId": "1",
                "wordsLimit": 150_000,
                "hasTrial": false,
                "initialTrialDurationDays": 100,
                "audiobookCredits": 100,
                "discountIds": [],
                "source": "play_store",
                "productTypes": ["tts","audiobooks","voiceover","dubbing","voicecloning"],
                "labels": ["premium"]
            }
        }
    ],
    "entitlements": {
        "isPremium": true,
        "hdWordsLeft": 1500,
        "nextHDWordsGrant": 0,
        "nextHDWordsGrantDate": null,
        "lastHdWordsGrantDate": new Date().toISOString(),
        "audiobookCreditsLeft": 0,
        "lastAudiobookCreditsGrantDate": new Date().toISOString(),
        "voiceoverSeconds": 0,
        "dubbingSeconds": 0,
        "avatarsSeconds": 0,
        "ttsExportSeconds": 0
    }
}

const {fetch: origFetch} = unsafeWindow;
unsafeWindow.fetch = async (...args) => {
  if(`${args?.[0]}`?.includes?.("getAllSubscriptions")){
     return new Response(JSON.stringify(mockedResponse));
  }

  return await origFetch(...args);
};

(function() {
    'use strict';
    localStorage.setItem('currentWordCount','0');
    setInterval(()=>{
        localStorage.setItem('currentWordCount','0');
    },1000);
})();