fix(threads): deepscan fixes

This commit is contained in:
Snazzah 2024-06-16 01:04:30 -05:00
parent 6db3b69639
commit 0e8e428485
No known key found for this signature in database
GPG Key ID: EA479766A94CEB61

View File

@ -20,7 +20,7 @@ const commonHeaders = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
};
const DATA_REGEX = /<script type="application\/json" data-content-len="\d+" data-sjs>({"require":\[\["ScheduledServerJS","handle",null,\[{"__bbox":{"require":\[\["RelayPrefetchedStreamCache(?:(?:@|\\u0040)[0-9a-f]{32})?","next",\[],\["adp_BarcelonaPostPageQueryRelayPreloader_[0-9a-f]{23}",[^\n]+})<\/script>\n/;
const DATA_REGEX = /<script type="application\/json" {2}data-content-len="\d+" data-sjs>({"require":\[\["ScheduledServerJS","handle",null,\[{"__bbox":{"require":\[\["RelayPrefetchedStreamCache(?:(?:@|\\u0040)[0-9a-f]{32})?","next",\[],\["adp_BarcelonaPostPageQueryRelayPreloader_[0-9a-f]{23}",[^\n]+})<\/script>\n/;
export default async function({ user, id, quality, dispatcher }) {
const cookie = getCookie('threads');
@ -31,7 +31,7 @@ export default async function({ user, id, quality, dispatcher }) {
},
dispatcher
});
if (cookie) updateCookie(cookie, data.headers);
if (cookie) updateCookie(cookie, response.headers);
if (response.status !== 200) {
return { error: 'ErrorCouldntFetch' };