mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +00:00
移除调试日志
This commit is contained in:
parent
ea0d136e36
commit
c9d6b5d1e3
@ -1,39 +1,5 @@
|
||||
<!DOCTYPE html> <meta name="darkreader-lock">
|
||||
<meta name="color-scheme" content="only light">
|
||||
|
||||
<!-- Network monitoring script for debugging -->
|
||||
<script>
|
||||
// 监控所有网络请求
|
||||
(function() {
|
||||
const originalFetch = window.fetch;
|
||||
window.fetch = function(...args) {
|
||||
console.log('[Network Monitor] Fetch request to:', args[0]);
|
||||
console.log('[Network Monitor] Request options:', args[1]);
|
||||
console.log('[Network Monitor] Full request details:', {
|
||||
url: args[0],
|
||||
method: args[1]?.method || 'GET',
|
||||
headers: args[1]?.headers || {},
|
||||
body: args[1]?.body || null
|
||||
});
|
||||
|
||||
return originalFetch.apply(this, args)
|
||||
.then(response => {
|
||||
console.log('[Network Monitor] Response received:');
|
||||
console.log(' - URL:', response.url);
|
||||
console.log(' - Status:', response.status, response.statusText);
|
||||
console.log(' - Headers:', Object.fromEntries(response.headers.entries()));
|
||||
console.log(' - Type:', response.type);
|
||||
console.log(' - Redirected:', response.redirected);
|
||||
return response;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('[Network Monitor] Fetch error for:', args[0]);
|
||||
console.error('[Network Monitor] Error details:', error);
|
||||
throw error;
|
||||
});
|
||||
};
|
||||
})();
|
||||
</script><html>
|
||||
<meta name="color-scheme" content="only light"><html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-height, initial-scale=1, maximum-scale=1">
|
||||
|
@ -14,6 +14,9 @@ export const currentApiURL = () => {
|
||||
if (env.DEFAULT_API && processingSettings.allowDefaultOverride) {
|
||||
return new URL(env.DEFAULT_API).origin;
|
||||
}
|
||||
|
||||
return new URL(apiURL).origin;
|
||||
|
||||
// 确保 apiURL 有值,否则使用硬编码的默认值
|
||||
const finalApiURL = apiURL || "https://api.freesavevideo.online/";
|
||||
|
||||
return new URL(finalApiURL).origin;
|
||||
}
|
||||
|
@ -61,12 +61,9 @@ const request = async (url: string) => {
|
||||
code: "error.captcha_ongoing"
|
||||
}
|
||||
} as CobaltErrorResponse;
|
||||
}
|
||||
} const api = currentApiURL();
|
||||
|
||||
const api = currentApiURL();
|
||||
|
||||
console.log("[Cobalt BAM] API endpoint URL:", api);
|
||||
console.log("[Cobalt BAM] Making POST request to:", `${api}/`);
|
||||
console.log("[Cobalt BAM] Making POST request to:", api);
|
||||
|
||||
const session = getCachedInfo?.info?.cobalt?.turnstileSitekey
|
||||
? await getSession() : undefined;
|
||||
@ -97,10 +94,6 @@ const request = async (url: string) => {
|
||||
},
|
||||
};
|
||||
|
||||
console.log("[Cobalt BAM] Full fetch options:", requestOptions);
|
||||
console.log("[Cobalt BAM] Request headers:", requestOptions.headers);
|
||||
console.log("[Cobalt BAM] Request body:", requestOptions.body);
|
||||
|
||||
const response: Optional<CobaltAPIResponse> = await fetch(api, requestOptions)
|
||||
.then(r => r.json())
|
||||
.catch((e) => {
|
||||
@ -111,11 +104,10 @@ const request = async (url: string) => {
|
||||
code: "error.api.timed_out"
|
||||
}
|
||||
} as CobaltErrorResponse;
|
||||
}
|
||||
});
|
||||
} });
|
||||
|
||||
// Log the API response
|
||||
console.log("[Cobalt BAM] API Response for URL", url, ":", response);
|
||||
console.log("[Cobalt BAM] API Response:", response);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user