Bascos Pixverse Video Bypass & Credit Restorer

Exploit Pixverse video generation and restore credits on refresh

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Bascos Pixverse Video Bypass & Credit Restorer
// @version      1.0
// @description  Exploit Pixverse video generation and restore credits on refresh
// @author       Basco
// @match        https://app.pixverse.ai/*
// @grant        none
// @run-at       document-end
// @namespace https://greasyfork.org/users/1458338
// ==/UserScript==

(function() {
    'use strict';

    // Function to modify the response for credits
    function modifyCreditsResponse(response) {
        console.log('Modifying credits response:', response);

        // Check if the response contains credit information and modify it
        if (response.data && response.data.Resp && response.data.Resp.credits) {
            // Set this to your desired credit count (e.g., restore credits to 100)
            response.data.Resp.credits = 100;
            console.log('Restored credits to:', response.data.Resp.credits);
        }

        return response;
    }

    // Intercepting and modifying the XHR response for credits
    const originalXHR = XMLHttpRequest.prototype.send;
    XMLHttpRequest.prototype.send = function () {
        this.addEventListener('load', function () {
            try {
                const response = JSON.parse(this.responseText);

                // If it's the /user/credits request, modify the response to restore credits
                if (this._url && this._url.includes('/creative_platform/user/credits')) {
                    modifyCreditsResponse(response);
                    this.responseText = JSON.stringify(response); // Set the modified response
                }

                // Log other responses if needed for debugging
                if (this._url && this._url.includes('/creative_platform/video/i2v')) {
                    console.log('Video generation response:', response);
                }
                if (this._url && this._url.includes('/creative_platform/video/list/personal')) {
                    console.log('Personal video list response:', response);
                }
                if (this._url && this._url.includes('/creative_platform/asset/list')) {
                    console.log('Asset list response:', response);
                }

            } catch (error) {
                console.error('Error while modifying XHR response:', error);
            }
        });
        originalXHR.apply(this, arguments);
    };

    // Log when a request to '/user/credits' is made to track credit status
    const originalOpen = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function (method, url) {
        if (url && url.includes('/creative_platform/user/credits')) {
            console.log('Request to /user/credits made:', url);
        }
        this._url = url; // Store the URL in the XHR object for later reference
        originalOpen.apply(this, arguments);
    };

    // Adding debugging to monitor requests made by the script
    const originalConsoleLog = console.log;
    console.log = function (message, ...args) {
        if (message.includes('XHR load event')) {
            console.debug('XHR Load Event:', message);
        }
        originalConsoleLog.apply(this, [message, ...args]);
    };

})();