vladkens / twscrape

2024! X / Twitter API scrapper with authorization support. Allows you to scrape search results, User's profiles (followers/following), Tweets (favoriters/retweeters) and more.
https://pypi.org/project/twscrape/
MIT License
1.13k stars 132 forks source link

Wrap async generators with contextlib.aclosing #159

Closed andylolz closed 7 months ago

andylolz commented 7 months ago

Fixes #158 – more details there.

It seems the aclosing context manager needs to be called for each nested async for loop. This PR does that.

Looks like #30 may have been due to the same problem – so this should resolve that, too.

vladkens commented 7 months ago

Very much thanks for your contribution!

It's frustrating to wrap everything in aclosing.

andylolz commented 7 months ago

Many thanks for merging – and thanks again for the library!