mirror of
https://github.com/p-stream/simple-proxy.git
synced 2026-01-11 20:10:35 +00:00
Update m3u8-proxy.ts
This commit is contained in:
parent
c6c5ffae3b
commit
d37f33313e
1 changed files with 3 additions and 1 deletions
|
|
@ -185,13 +185,15 @@ async function proxyM3U8(event: any) {
|
|||
try {
|
||||
const response = await globalThis.fetch(url, {
|
||||
headers: {
|
||||
// Default User-Agent (from src/utils/headers.ts)
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0',
|
||||
...(headers as HeadersInit),
|
||||
}
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text().catch(() => '');
|
||||
console.error(`Failed to fetch M3U8: ${response.status} ${response.statusText} for URL: ${url}`);
|
||||
console.error(`Response body: ${errorText}`);
|
||||
throw new Error(`Failed to fetch M3U8: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue