mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-27 21:26:18 +01:00
api/twitter: got rate limit try with cookies
This commit is contained in:
parent
0e5914f66c
commit
0c3fed81c9
1 changed files with 5 additions and 0 deletions
|
@ -115,6 +115,11 @@ export default async function({ id, index, toGif, dispatcher, alwaysProxy }) {
|
||||||
tweet = await requestTweet(dispatcher, id, guestToken)
|
tweet = await requestTweet(dispatcher, id, guestToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the tweet reached the rate limit, we need to retry with the cookie
|
||||||
|
if ([404].includes(tweet.status)) {
|
||||||
|
tweet = await requestTweet(dispatcher, id, guestToken, cookie);
|
||||||
|
}
|
||||||
|
|
||||||
tweet = await tweet.json();
|
tweet = await tweet.json();
|
||||||
|
|
||||||
let tweetTypename = tweet?.data?.tweetResult?.result?.__typename;
|
let tweetTypename = tweet?.data?.tweetResult?.result?.__typename;
|
||||||
|
|
Loading…
Reference in a new issue