From 5b295effdd8ff980f319c975a9ec4b69879d5358 Mon Sep 17 00:00:00 2001 From: Aleksei Kovura <3616242+alex3kov@users.noreply.github.com> Date: Mon, 6 Nov 2017 11:12:35 +0300 Subject: [PATCH] If password was not found in keyring - don't ask for it, just fail with error. --- youtube_dl/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index fba9621d3..4338d5ed1 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -155,13 +155,7 @@ def _real_main(argv=None): domain_name = all_domains.pop() password = Secret.password_lookup_sync(LIBSECRET_SCHEMA, {"user-name": opts.username, "domain-name": domain_name}, None) if password is None: - print("Password for domain " + domain_name + " and user name " + opts.username + " not found in the keyring.") - supplied_password = compat_getpass('Type account password and press [Return]: ') - attributes = {"user-name": opts.username, "domain-name": domain_name} - label = "Youtube-dl: " + domain_name + " password" - Secret.password_store_sync(LIBSECRET_SCHEMA, attributes, Secret.COLLECTION_DEFAULT, label, supplied_password, None) - password = Secret.password_lookup_sync(LIBSECRET_SCHEMA, {"user-name": opts.username, "domain-name": domain_name}, None) - opts.password = password + parser.error('Password not found in keyring/wallet') if opts.username is not None and opts.password is None and opts.keyring is False: opts.password = compat_getpass('Type account password and press [Return]: ') if opts.ap_username is not None and opts.ap_password is None: