From ce6aa0e1ceec0f1d918645cda48f431a6b2e28a9 Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 29 Apr 2023 17:05:32 +0600 Subject: [PATCH] bump youtubei.js to 5.0.0 and remove unnecessary twitter cookies --- package.json | 2 +- src/modules/processing/services/twitter.js | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index e15b31a5..9a3fafd6 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,6 @@ "node-cache": "^5.1.2", "url-pattern": "1.0.3", "xml-js": "^1.6.11", - "youtubei.js": "4.3.0" + "youtubei.js": "5.0.0" } } diff --git a/src/modules/processing/services/twitter.js b/src/modules/processing/services/twitter.js index 7e010eda..1f7d23f6 100644 --- a/src/modules/processing/services/twitter.js +++ b/src/modules/processing/services/twitter.js @@ -26,12 +26,7 @@ export default async function(obj) { if (!req_act) return { error: 'ErrorCouldntFetch' }; _headers["x-guest-token"] = req_act["guest_token"]; - _headers["cookie"] = [ - `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('; '); + _headers["cookie"] = `guest_id=v1%3A${req_act["guest_token"]};`; if (!obj.spaceId) { 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 }); if (!req_act) return { error: 'ErrorCouldntFetch' }; - _headers["x-guest-token"] = req_act["guest_token"] - _headers['cookie'] = [ - `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('; '); + _headers["x-guest-token"] = req_act["guest_token"]; + _headers['cookie'] = `guest_id=v1%3A${req_act["guest_token"]};`; conversation = await fetch(conversationURL, { headers: _headers }).then((r) => { return r.status === 200 ? r.json() : false }).catch(() => { return false }); }