Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No account available for queue "SearchTimeline" #49

Closed
kasmirc opened this issue Jul 31, 2023 · 10 comments
Closed

No account available for queue "SearchTimeline" #49

kasmirc opened this issue Jul 31, 2023 · 10 comments
Labels

Comments

@kasmirc
Copy link

kasmirc commented Jul 31, 2023

Hello, thanks for your great work!
I'm getting a message "2023-07-31 13:12:01.671 | INFO | twscrape.accounts_pool:get_for_queue_or_wait:260 - No account available for queue "SearchTimeline". Next available at 23:40:06"

I'm using this code:

import asyncio
from twscrape import API, gather
from twscrape.logger import set_log_level

async def main():
api = API() # or API("path-to.db") - default is accounts.db
# ADD ACCOUNTS (for CLI usage see BELOW)
cookies_acc1 = xxx <<I use your method to obtain cookies from Issue #45 >>
cookies_acc2 = xxx
cookies_acc3 = xxx
cookies_acc4 = xxx

await api.pool.add_account("user1", "pass1", "u1@example.com", "mail_pass1", cookies = cookies_acc1) <<of course I use my login data for the accounts>>
await api.pool.add_account("user2", "pass2", "u2@example.com", "mail_pass2", cookies = cookies_acc2)
await api.pool.add_account("user3", "pass3", "u3@example.com", "mail_pass3", cookies = cookies_acc3)
await api.pool.add_account("user4", "pass4", "u4@example.com", "mail_pass4", cookies = cookies_acc4)
await api.pool.login_all()

# API USAGE

# search (latest tab)
await gather(api.search("elon musk", limit=20))  # list[Tweet]

# tweet info
tweet_id = 20
await api.tweet_details(tweet_id)  # Tweet
await gather(api.retweeters(tweet_id, limit=20))  # list[User]
await gather(api.favoriters(tweet_id, limit=20))  # list[User]

# get user by login
user_login = "twitterdev"
await api.user_by_login(user_login)  # User

# user info
user_id = 2244994945
await api.user_by_id(user_id)  # User
await gather(api.followers(user_id, limit=20))  # list[User]
await gather(api.following(user_id, limit=20))  # list[User]
await gather(api.user_tweets(user_id, limit=20))  # list[Tweet]
await gather(api.user_tweets_and_replies(user_id, limit=20))  # list[Tweet]

# list info
list_id = 123456789
await gather(api.list_timeline(list_id))

# NOTE 1: gather is a helper function to receive all data as list, FOR can be used as well:
async for tweet in api.search("elon musk"):
    print(tweet.id, tweet.user.username, tweet.rawContent)  # tweet is `Tweet` object

# # NOTE 2: all methods have `raw` version (returns `httpx.Response` object):
async for rep in api.search_raw("elon musk"):
    print(rep.status_code, rep.json())  # rep is `httpx.Response` object

# change log level, default info
set_log_level("DEBUG")

# Tweet & User model can be converted to regular dict or json, e.g.:
doc = await api.user_by_id(user_id)  # User
doc.dict()  # -> python dict
doc.json()  # -> json string

if name == "main":
asyncio.run(main())

My output is this:
2023-07-31 13:12:01.656 | WARNING | twscrape.accounts_pool:add_account:76 - Account user1 already exists
2023-07-31 13:12:01.659 | WARNING | twscrape.accounts_pool:add_account:76 - Account user2 already exists
2023-07-31 13:12:01.663 | WARNING | twscrape.accounts_pool:add_account:76 - Account user3 already exists
2023-07-31 13:12:01.665 | WARNING | twscrape.accounts_pool:add_account:76 - Account user4 already exists
2023-07-31 13:12:01.671 | INFO | twscrape.accounts_pool:get_for_queue_or_wait:260 - No account available for queue "SearchTimeline". Next available at 23:40:06

Is there something wrong with my accounts? Or I'm doing something wrong here? I have one account created on gmail, one on yahoo, one on hotmail and one on some Polish website (o2.pl).
Thanks for help in advance!

@dwicak
Copy link

dwicak commented Aug 2, 2023

Hello, thanks for your great work! I'm getting a message "2023-07-31 13:12:01.671 | INFO | twscrape.accounts_pool:get_for_queue_or_wait:260 - No account available for queue "SearchTimeline". Next available at 23:40:06"

I'm using this code:

import asyncio from twscrape import API, gather from twscrape.logger import set_log_level

async def main(): api = API() # or API("path-to.db") - default is accounts.db # ADD ACCOUNTS (for CLI usage see BELOW) cookies_acc1 = xxx <<I use your method to obtain cookies from Issue #45 >> cookies_acc2 = xxx cookies_acc3 = xxx cookies_acc4 = xxx

await api.pool.add_account("user1", "pass1", "u1@example.com", "mail_pass1", cookies = cookies_acc1) <<of course I use my login data for the accounts>>
await api.pool.add_account("user2", "pass2", "u2@example.com", "mail_pass2", cookies = cookies_acc2)
await api.pool.add_account("user3", "pass3", "u3@example.com", "mail_pass3", cookies = cookies_acc3)
await api.pool.add_account("user4", "pass4", "u4@example.com", "mail_pass4", cookies = cookies_acc4)
await api.pool.login_all()

# API USAGE

# search (latest tab)
await gather(api.search("elon musk", limit=20))  # list[Tweet]

# tweet info
tweet_id = 20
await api.tweet_details(tweet_id)  # Tweet
await gather(api.retweeters(tweet_id, limit=20))  # list[User]
await gather(api.favoriters(tweet_id, limit=20))  # list[User]

# get user by login
user_login = "twitterdev"
await api.user_by_login(user_login)  # User

# user info
user_id = 2244994945
await api.user_by_id(user_id)  # User
await gather(api.followers(user_id, limit=20))  # list[User]
await gather(api.following(user_id, limit=20))  # list[User]
await gather(api.user_tweets(user_id, limit=20))  # list[Tweet]
await gather(api.user_tweets_and_replies(user_id, limit=20))  # list[Tweet]

# list info
list_id = 123456789
await gather(api.list_timeline(list_id))

# NOTE 1: gather is a helper function to receive all data as list, FOR can be used as well:
async for tweet in api.search("elon musk"):
    print(tweet.id, tweet.user.username, tweet.rawContent)  # tweet is `Tweet` object

# # NOTE 2: all methods have `raw` version (returns `httpx.Response` object):
async for rep in api.search_raw("elon musk"):
    print(rep.status_code, rep.json())  # rep is `httpx.Response` object

# change log level, default info
set_log_level("DEBUG")

# Tweet & User model can be converted to regular dict or json, e.g.:
doc = await api.user_by_id(user_id)  # User
doc.dict()  # -> python dict
doc.json()  # -> json string

if name == "main": asyncio.run(main())

My output is this: 2023-07-31 13:12:01.656 | WARNING | twscrape.accounts_pool:add_account:76 - Account user1 already exists 2023-07-31 13:12:01.659 | WARNING | twscrape.accounts_pool:add_account:76 - Account user2 already exists 2023-07-31 13:12:01.663 | WARNING | twscrape.accounts_pool:add_account:76 - Account user3 already exists 2023-07-31 13:12:01.665 | WARNING | twscrape.accounts_pool:add_account:76 - Account user4 already exists 2023-07-31 13:12:01.671 | INFO | twscrape.accounts_pool:get_for_queue_or_wait:260 - No account available for queue "SearchTimeline". Next available at 23:40:06

Is there something wrong with my accounts? Or I'm doing something wrong here? I have one account created on gmail, one on yahoo, one on hotmail and one on some Polish website (o2.pl). Thanks for help in advance!

I got the same error. There's any solution? My account is in Gmail.

@samuelgja
Copy link

same here!

@AliSamhat07
Copy link

same... Isn't there any solution yet?

@pawertrem
Copy link

I have faced with the same issue - would be glad to hear if anyone has found out some handling

@reddere
Copy link

reddere commented Sep 26, 2023

Similar encounter here. No account available for queue "UserTweets". Next available at 21:23:41

How to fix this? I had to downgrade to 0.5.0 just because of this...

@AgungPambudi
Copy link

)) # list[Tweet]
await gather(api.user_tweets_and_replies(user_id, limit=20)) # list[Tweet]

list info

list_id = 123456789

same here

image

@LucasLeRay
Copy link
Contributor

LucasLeRay commented Oct 30, 2023

I have the same issue.

EDIT: In my case, it's because I used gather on api.search, but with the default limit (being -1), so I reached the limit before being able to get the output (and waited 15m for the limit to turn off):

# This doesn't work
await gather(api.search(q))  # implicit limit of -1

# This works
await gather(api.search(q, limit=1))

I don't think this applies in the author's case, though, since all search queries have an explicit, low limit.

@Mohamed3on
Copy link

Same issue, I added my account with cookies (didn't log in), but I still can't perform any functionality due to this error.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Feb 12, 2024
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants