chore(example/browser): fix ALR requests failing

This commit is contained in:
LuanRT
2023-08-18 06:33:01 -03:00
parent 9971ffe021
commit eb3cca1e2e

View File

@@ -115,12 +115,7 @@ async function main() {
showUI({ hidePlayer: false });
const dash = await info.toDash((url) => {
url.searchParams.set('__host', url.host);
url.host = 'localhost:8080';
url.protocol = 'http';
return url;
});
const dash = await info.toDash();
const uri = 'data:application/dash+xml;charset=utf-8;base64,' + btoa(dash);
@@ -183,6 +178,12 @@ async function main() {
const url = new URL(uri);
const headers = request.headers;
if (url.host.endsWith(".googlevideo.com") || headers.Range) {
url.searchParams.set('__host', url.host);
url.host = 'localhost:8080';
url.protocol = 'http';
}
request.method = 'POST';
// protobuf - { 15: 0 }