Closed xuya227939 closed 1 month ago
I use proxy, but get error
Line:40 🍷 url https://www.youtube.com/iframe_api Fetch error for https://www.youtube.com/iframe_api. Retrying in 2 seconds...
Line:40 🍷 url https://www.youtube.com/sw.js_data Fetch error for https://www.youtube.com/sw.js_data. Retrying in 2 seconds...
Tell me why? Please, Thank you.
const initializeInnertube = async () => { const proxyAgent = new HttpsProxyAgent( "https://v2sub.com/xxx" ); return await Innertube.create({ fetch: async (input, init) => { const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url; const modifiedInit = { ...init, method: init?.method || (init?.body ? "POST" : "GET"), agent: proxyAgent, }; if (modifiedInit.method === "POST") modifiedInit.headers = { ...modifiedInit.headers, "Content-Type": "application/json", }; const maxRetries = 5; let retryCount = 0; const fetchWithRetry = async () => { try { const response = await fetch(url, modifiedInit); if (!response.ok) { if (response.status === 429) { console.warn( `Too Many Requests. Retrying in ${delayTime / 1000} seconds...` ); } throw new Error(`Failed to fetch ${url}: ${response.statusText}`); } return response; } catch (error) { throw new Error(`Fetch error for ${url}: ${error.message}`); } }; return fetchWithRetry(); }, }); };
No response
i have no clue how this is related to cobalt in any way, create a new issue describing the issue
problem description
Describe your suggestion
I use proxy, but get error
Error
Line:40 🍷 url https://www.youtube.com/iframe_api Fetch error for https://www.youtube.com/iframe_api. Retrying in 2 seconds...
Line:40 🍷 url https://www.youtube.com/sw.js_data Fetch error for https://www.youtube.com/sw.js_data. Retrying in 2 seconds...
Tell me why? Please, Thank you.
Code
your instance configuration
No response