mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 01:18:27 +00:00
排查错误
This commit is contained in:
parent
1733ae76e2
commit
ea0d136e36
@ -1,5 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!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>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-height, initial-scale=1, maximum-scale=1">
|
||||
|
@ -65,6 +65,9 @@ const request = async (url: string) => {
|
||||
|
||||
const api = currentApiURL();
|
||||
|
||||
console.log("[Cobalt BAM] API endpoint URL:", api);
|
||||
console.log("[Cobalt BAM] Making POST request to:", `${api}/`);
|
||||
|
||||
const session = getCachedInfo?.info?.cobalt?.turnstileSitekey
|
||||
? await getSession() : undefined;
|
||||
|
||||
@ -80,9 +83,11 @@ const request = async (url: string) => {
|
||||
"Authorization": `Bearer ${session.token}`,
|
||||
};
|
||||
}
|
||||
} const response: Optional<CobaltAPIResponse> = await fetch(api, {
|
||||
}
|
||||
|
||||
const requestOptions = {
|
||||
method: "POST",
|
||||
redirect: "manual",
|
||||
redirect: "manual" as RequestRedirect,
|
||||
signal: AbortSignal.timeout(10000),
|
||||
body: JSON.stringify(request),
|
||||
headers: {
|
||||
@ -90,7 +95,13 @@ const request = async (url: string) => {
|
||||
"Content-Type": "application/json",
|
||||
...extraHeaders,
|
||||
},
|
||||
})
|
||||
};
|
||||
|
||||
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) => {
|
||||
if (e?.message?.includes("timed out")) {
|
||||
|
@ -54,7 +54,7 @@
|
||||
<div class="notification" role="alert">
|
||||
<div class="notification-content">
|
||||
<span class="notification-icon">🎉</span>
|
||||
<span class="notification-text">竹子下载最新添加了对小红书和油管下载的支持</span> <button
|
||||
<span class="notification-text">竹子下载遇到了些问题,正在维修中...</span> <button
|
||||
class="notification-close"
|
||||
aria-label="关闭通知"
|
||||
on:click={closeNotification}
|
||||
|
Loading…
Reference in New Issue
Block a user