temp yt polymer fix (fix properly when cors headers are fully parsed)

This commit is contained in:
ProgrammerIn-wonderland 2024-10-06 01:00:19 -04:00
parent 7e11458621
commit c4070bbd6d
No known key found for this signature in database

View file

@ -80,8 +80,12 @@ export async function swfetch(
) { ) {
// TODO: i was against cors emulation but we might actually break stuff if we send full origin/referrer always // TODO: i was against cors emulation but we might actually break stuff if we send full origin/referrer always
const url = new URL(decodeUrl(client.url)); const url = new URL(decodeUrl(client.url));
headers.set("Referer", url.toString()); if (url.toString().includes("youtube.com")) {
headers.set("Origin", url.origin); console.log(headers);
} else {
headers.set("Referer", url.toString());
headers.set("Origin", url.origin);
}
} }
const cookies = this.cookieStore.getCookies(url, false); const cookies = this.cookieStore.getCookies(url, false);