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

Getting Keyerror with TwitterTweetScraper(tweet_id) #495

Closed
msramalho opened this issue Jun 16, 2022 · 1 comment
Closed

Getting Keyerror with TwitterTweetScraper(tweet_id) #495

msramalho opened this issue Jun 16, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@msramalho
Copy link

Most recent version on pypi used: 0.4.3.20220106

from snscrape.modules.twitter import TwitterTweetScraper

scr = TwitterTweetScraper("1537440741290430470")
tweet = next(scr.get_items()) # <- KeyError here

Error log

Traceback (most recent call last):
  File "/......../code.py", line 31, in download
    tweet = next(scr.get_items())
  File "/......../code/python3.9/site-packages/snscrape/modules/twitter.py", line 887, in get_items
    yield self._tweet_to_tweet(obj['globalObjects']['tweets'][str(self._tweetId)], obj)
KeyError: '1537440741290430470'
@JustAnotherArchivist
Copy link
Owner

This is #415 with a dash of #419. The current master code doesn't crash (but also doesn't return the tweet contents because of the age restriction). But yeah, a new release is overdue. Will try to get that out soonish.

@JustAnotherArchivist JustAnotherArchivist added the duplicate This issue or pull request already exists label Jun 16, 2022
@JustAnotherArchivist JustAnotherArchivist closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants