mpd-not: support mpd passwords
This commit is contained in:
parent
cd23f062a9
commit
07eb3aabe8
@ -24,6 +24,7 @@ parser.add_argument('-l', '--location')
|
||||
parser.add_argument('-u', '--user')
|
||||
parser.add_argument('-m', '--mpd-host', default='localhost')
|
||||
parser.add_argument('-p', '--mpd-port', default=6600)
|
||||
parser.add_argument('-a', '--mpd-password', action='store_true')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.user is None or args.location is None:
|
||||
@ -38,6 +39,10 @@ auth = HTTPBasicAuth(args.user, password)
|
||||
client = mpd.MPDClient(use_unicode=True)
|
||||
client.connect(args.mpd_host, args.mpd_port)
|
||||
|
||||
if args.mpd_password:
|
||||
mpd_password = getpass.getpass("password for mpd: ")
|
||||
client.password(mpd_password)
|
||||
|
||||
last_np = ''
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user