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

[Feature request] Exit when no good account instead of waiting, for AWS Lambda #148

Closed
vsnig opened this issue Mar 17, 2024 · 2 comments
Closed
Milestone

Comments

@vsnig
Copy link

vsnig commented Mar 17, 2024

I think we need an option to just exit when there's no good account. It's appropriate when running on AWS Lambda

P.S. now I'm thinking that probably the best option is to raise an Exception. This way we can use Lambda's native retry mechanism, or catch and ignore or react the way we wish

@vsnig vsnig changed the title Exit when no good account instead of waiting, for AWS Lambda [Feature request] Exit when no good account instead of waiting, for AWS Lambda Mar 17, 2024
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.

@vladkens
Copy link
Owner

Will be added in v0.12.

Usage:

from twscrape import API, NoAccountError

api = API(raise_when_no_account=True)
try:
    api.search("foo", limit=10)
except NoAccountError:
    pass

Or with environment variable:

TWS_RAISE_WHEN_NO_ACCOUNT=1 twscrape tweet_details 1778577341163110904

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants