Storing pHash. Fixed RedGIFs user agent.

This commit is contained in:
2024-09-11 05:16:58 +02:00
parent 3931996e1b
commit b7dc3f5fd1
15 changed files with 852 additions and 94 deletions

View File

@@ -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}'`);
}

View File

@@ -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,
},
};