-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Crash with KeyError when trying to fetch post author's username #824
Comments
Here's a post URL this happened for: https://www.instagram.com/p/CFsmkKfJLpB/. I checked it seconds after the error occurred, but the post was (already?) deleted. Perhaps the post was deleted between the index scrape and fetching the username? |
Thanks for reporting this! It might be that the post was deleted between the index scrape and fetching the username, however, that should not lead Instaloader to fail. The KeyError is thrown in a code block executed when the metadata fetch fails: instaloader/instaloader/structures.py Lines 149 to 154 in f4ecfea
The KeyError is raised when accessing the nonexistant |
Hi @aandergr , |
Yes, the error message (lines 150-153) can be removed. |
Describe the bug
When scraping data, the scraper occasionally crashes with a JSON error while retrieving the username of a post's poster. A field seems to be missing from the Instagram response -
KeyError: 'entry_data'
.To Reproduce
The code was part of a larger project but the relevant part can be boiled down to:
Unfortunately the hashtag I tried this with is very high volume so I was not able to find the specific post this happened with. I have observed it on multiple occasions though. I will try to find a specific post this happens for and will update the issue if I do.
Expected behavior
No crash!
Error messages and tracebacks
Instaloader version
4.5.3 on Python 3.7/Windows
Additional context
I believe this bug was reported on an earlier occasion in #752.
The text was updated successfully, but these errors were encountered: