1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-10-02 13:27:07 +02:00

Catch KeyboardInterrupt when asking for password

This commit is contained in:
Alexander Graf 2024-05-30 10:22:45 +02:00
parent 0c7398882b
commit dc1eb2b193

View File

@ -196,7 +196,11 @@ def _main(instaloader: Instaloader, targetlist: List[str],
print(err, file=sys.stderr)
pass
else:
try:
instaloader.interactive_login(username)
except KeyboardInterrupt:
print("\nInterrupted by user.", file=sys.stderr)
return ExitCode.USER_ABORTED
instaloader.context.log("Logged in as %s." % username)
# since 4.2.9 login is required for geotags
if instaloader.download_geotags and not instaloader.context.is_logged_in: