interactively prompt for passwords on login when none is provided

pull/4906/head
Mike Fährmann 10 months ago
parent db978b34f1
commit 9dd5cb8c8a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -379,7 +379,7 @@ Description
The username and password to use when attempting to log in to
another site.
Specifying a username and password is required for
Specifying username and password is required for
* ``nijie``
@ -415,6 +415,10 @@ Description
(*) The password value for these sites should be
the API key found in your user profile, not the actual account password.
Note: Leave the ``password`` value empty or undefined
to get prompted for a passeword when performing a login
(see `getpass() <https://docs.python.org/3/library/getpass.html#getpass.getpass>`__).
extractor.*.netrc
-----------------

@ -233,7 +233,7 @@ class Extractor():
password = None
if username:
password = self.config("password")
password = self.config("password") or util.LazyPrompt()
elif self.config("netrc", False):
try:
info = netrc.netrc().authenticators(self.category)

@ -14,6 +14,7 @@ import sys
import json
import time
import random
import getpass
import hashlib
import sqlite3
import binascii
@ -487,6 +488,13 @@ CODES = {
}
class LazyPrompt():
__slots__ = ()
def __str__(self):
return getpass.getpass()
class CustomNone():
"""None-style type that supports more operations than regular None"""
__slots__ = ()

Loading…
Cancel
Save