Improve error handling and email visibility in core.py#190
Open
debpramanik wants to merge 1 commit intomegadose:masterfrom
Open
Improve error handling and email visibility in core.py#190debpramanik wants to merge 1 commit intomegadose:masterfrom
debpramanik wants to merge 1 commit intomegadose:masterfrom
Conversation
The following error occurred when running the tool on some accounts (e.g., private accounts without IGTV data):
Informations about : [username redacted]
userID : [userID redacted]
Full Name : [full name redacted]
Verified : False | Is buisness Account : False
Is private Account : True
Follower : 7 | Following : 12
Number of posts : 0
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/toutatis/core.py", line 125, in <module>
sys.exit(load_entry_point('toutatis==1.31', 'console_scripts', 'toutatis')())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/toutatis/core.py", line 125, in main
print("IGTV posts : " + str(infos["total_igtv_videos"]))
~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'total_igtv_videos'
Changes Made:
Fixed KeyError by using safe dictionary access for 'total_igtv_videos'.
Enhanced public email reporting to always indicate presence/absence.
Enhanced obfuscated email reporting to always indicate presence/absence.
Benefits: Prevents crashes, improves robustness, and provides clearer output for users.
Files Changed: toutatis/toutatis/core.py
Testing: Verified on multiple usernames; no crashes, and email status is now always reported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Fixed
The tool was crashing on certain accounts (e.g., private accounts without IGTV data) due to a KeyError when accessing missing API fields.
Error Example
Changes Made
.get()) fortotal_igtv_videosfieldBenefits
Files Changed
toutatis/core.pyTesting
Verified on multiple Instagram usernames including:
No crashes observed, and email status is now always reported consistently.