mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-13 13:47:38 +02:00
reddit: fix downloads not working without cookies
This commit is contained in:
@ -59,9 +59,13 @@ export default async function(obj) {
|
||||
|
||||
let data = await fetch(
|
||||
url, {
|
||||
headers: accessToken && { authorization: `Bearer ${accessToken}` }
|
||||
headers: {
|
||||
'User-Agent': genericUserAgent,
|
||||
accept: 'application/json',
|
||||
authorization: accessToken && `Bearer ${accessToken}`
|
||||
}
|
||||
}
|
||||
).then(r => r.json() ).catch(() => {});
|
||||
).then(r => r.json()).catch(() => {});
|
||||
|
||||
if (!data || !Array.isArray(data)) return { error: 'ErrorCouldntFetch' };
|
||||
|
||||
|
Reference in New Issue
Block a user