JavaScript的:
// ==UserScript==
// @name pixverse nsfw video bypass
// @match https://app.pixverse.ai/*
// @run-at document-start
// @version 1.0
// … (read more)
JavaScript的:
// ==UserScript==
// @name pixverse nsfw video bypass
// @match https://app.pixverse.ai/*
// @run-at document-start
// @version 1.0
// @author cptdan
// ==/UserScript==
(function() {
'use strict';
function waitForAxios() {
if (typeof axios !== 'undefined') {
patchAxios();
} else {
setTimeout(waitForAxios, 10);
}
}
function modifyResponseData(data) {
if (Array.isArray(data)) {
return data.map(item => {
const modifiedItem = item;
if(item.video_status === 7){
modifiedItem.video_status = 1;
}
if (item.extended === 1) {
modifiedItem.first_frame = item.customer_paths?.customer_video_last_frame_url;
} else {
modifiedItem.first_frame = item.customer_paths?.customer_img_url;
}
modifiedItem.url = 'https://media.pixverse.ai/' + item.video_path;
return modifiedItem;
});
}
return data;
}
function patchAxios() {
const originalCreate = axios.create;
axios.create = function(config) {
const instance = originalCreate.apply(this, arguments);
const instancePost = instance.post;
instance.post = function(url, data, config) {
if (url && url.includes('/video/list/personal')) {
const promise = instancePost.apply(this, arguments);
return promise.then(response => {
const modifiedData = modifyResponseData(response.data);
const modifiedResponse = {
...response,
data: modifiedData
};
return modifiedResponse;
}).catch(error => {
console.error('[Axios Instance POST /video/list/personal] Error:', {
url: url,
error: error.message,
timestamp: new Date().toISOString()
});
throw error;
});
}
return instancePost.apply(this, arguments);
};
return instance;
};
console.log('Axios patching for /video/list/personal complete');
}
waitForAxios();
})();