mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-21 15:47:06 +02:00
bump youtubei.js to 5.0.0 and remove unnecessary twitter cookies
This commit is contained in:
parent
8f93232e81
commit
ce6aa0e1ce
@ -34,6 +34,6 @@
|
|||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
"url-pattern": "1.0.3",
|
"url-pattern": "1.0.3",
|
||||||
"xml-js": "^1.6.11",
|
"xml-js": "^1.6.11",
|
||||||
"youtubei.js": "4.3.0"
|
"youtubei.js": "5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,7 @@ export default async function(obj) {
|
|||||||
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
||||||
|
|
||||||
_headers["x-guest-token"] = req_act["guest_token"];
|
_headers["x-guest-token"] = req_act["guest_token"];
|
||||||
_headers["cookie"] = [
|
_headers["cookie"] = `guest_id=v1%3A${req_act["guest_token"]};`;
|
||||||
`guest_id_ads=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`guest_id_marketing=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`guest_id=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`ct0=${crypto.randomUUID().replace(/-/g, '')};`
|
|
||||||
].join('; ');
|
|
||||||
|
|
||||||
if (!obj.spaceId) {
|
if (!obj.spaceId) {
|
||||||
let conversation = await fetch(conversationURL, { headers: _headers }).then((r) => { return r.status === 200 ? r.json() : false }).catch((e) => { return false });
|
let conversation = await fetch(conversationURL, { headers: _headers }).then((r) => { return r.status === 200 ? r.json() : false }).catch((e) => { return false });
|
||||||
@ -47,13 +42,8 @@ export default async function(obj) {
|
|||||||
}).then((r) => { return r.status === 200 ? r.json() : false}).catch(() => { return false });
|
}).then((r) => { return r.status === 200 ? r.json() : false}).catch(() => { return false });
|
||||||
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
if (!req_act) return { error: 'ErrorCouldntFetch' };
|
||||||
|
|
||||||
_headers["x-guest-token"] = req_act["guest_token"]
|
_headers["x-guest-token"] = req_act["guest_token"];
|
||||||
_headers['cookie'] = [
|
_headers['cookie'] = `guest_id=v1%3A${req_act["guest_token"]};`;
|
||||||
`guest_id_ads=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`guest_id_marketing=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`guest_id=v1%3A${req_act["guest_token"]}`,
|
|
||||||
`ct0=${crypto.randomUUID().replace(/-/g, '')};`
|
|
||||||
].join('; ');
|
|
||||||
|
|
||||||
conversation = await fetch(conversationURL, { headers: _headers }).then((r) => { return r.status === 200 ? r.json() : false }).catch(() => { return false });
|
conversation = await fetch(conversationURL, { headers: _headers }).then((r) => { return r.status === 200 ? r.json() : false }).catch(() => { return false });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user