Storing pHash. Fixed RedGIFs user agent.
This commit is contained in:
@@ -31,7 +31,7 @@ async function fetchPredata() {
|
||||
return data;
|
||||
}
|
||||
|
||||
async function imgurImageApi(host, post, { predata } = {}) {
|
||||
async function imgurImageApi(host, post, { predata }) {
|
||||
if (predata.remaining === 10) { // keep a buffer
|
||||
throw new Error(`Reached Imgur API rate limit with source '${host.url}'`);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ async function fetchPredata() {
|
||||
address: data.addr,
|
||||
agent: data.agent,
|
||||
token: data.token,
|
||||
userAgent,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ async function redgifsApi(host, post, { predata }) {
|
||||
const res = await fetch(`https://api.redgifs.com/v2/gifs/${host.id.toLowerCase()}`, {
|
||||
headers: {
|
||||
authorization: `Bearer ${predata.token}`,
|
||||
'user-agent': predata.userAgent,
|
||||
'user-agent': predata.agent,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -99,7 +98,7 @@ async function redgifsApi(host, post, { predata }) {
|
||||
original: data.gif,
|
||||
}],
|
||||
headers: {
|
||||
'user-agent': predata.userAgent,
|
||||
'user-agent': predata.agent,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user