mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
reddit: fix downloads not working without cookies
This commit is contained in:
parent
44292ea622
commit
e4646a9ff3
|
@ -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' };
|
||||
|
||||
|
|
Loading…
Reference in a new issue