1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-11-19 16:52:30 +01: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) print(err, file=sys.stderr)
pass pass
else: else:
instaloader.interactive_login(username) 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) instaloader.context.log("Logged in as %s." % username)
# since 4.2.9 login is required for geotags # since 4.2.9 login is required for geotags
if instaloader.download_geotags and not instaloader.context.is_logged_in: if instaloader.download_geotags and not instaloader.context.is_logged_in: