diff --git a/README.md b/README.md index 947e2f5..625c0a2 100644 --- a/README.md +++ b/README.md @@ -38,24 +38,6 @@ qobuz-dl.exe > If something fails, run `qobuz-dl -r` to reset your config file. ## Examples -### Interactive mode -Run interactive mode with a limit of 10 results -``` -qobuz-dl fun -l 10 -``` -Now you can search albums and tracks: -``` -Logging... -Logged: OK -Membership: Studio - - -Enter your search: [Ctrl + c to quit] -- fka twigs magdalene -``` -Everything else is interactive. Enjoy. - -Run `qobuz-dl fun --help` for more info. ### Download mode Download URL in 24B<96khz quality @@ -81,6 +63,25 @@ qobuz-dl dl https://play.qobuz.com/playlist/5388296 -q 27 Run `qobuz-dl dl --help` for more info. +### Interactive mode +Run interactive mode with a limit of 10 results +``` +qobuz-dl fun -l 10 +``` +Type your search query +``` +Logging... +Logged: OK +Membership: Studio + + +Enter your search: [Ctrl + c to quit] +- fka twigs magdalene +``` +Now choose whatever releases you want to download. Everything else is interactive. Enjoy. + +Run `qobuz-dl fun --help` for more info. + ### Lucky mode Download the first album result ``` diff --git a/qobuz_dl/cli.py b/qobuz_dl/cli.py index 024a22e..e2cf9ac 100644 --- a/qobuz_dl/cli.py +++ b/qobuz_dl/cli.py @@ -1,4 +1,5 @@ import argparse +import base64 import configparser import os import re @@ -27,7 +28,9 @@ def reset_config(config_file): print("Creating config file: " + config_file) config = configparser.ConfigParser() config["DEFAULT"]["email"] = input("\nEnter your email:\n- ") - config["DEFAULT"]["password"] = input("\nEnter your password\n- ") + config["DEFAULT"]["password"] = base64.b64encode( + input("\nEnter your password\n- ").encode() + ).decode() config["DEFAULT"]["default_folder"] = ( input("\nFolder for downloads (leave empy for default 'Qobuz Downloads')\n- ") or "Qobuz Downloads" @@ -252,7 +255,7 @@ def main(): try: email = config["DEFAULT"]["email"] - password = config["DEFAULT"]["password"] + password = base64.b64decode(config["DEFAULT"]["password"]).decode() default_folder = config["DEFAULT"]["default_folder"] default_limit = config["DEFAULT"]["default_limit"] default_quality = config["DEFAULT"]["default_quality"] @@ -263,7 +266,7 @@ def main(): arguments = qobuz_dl_args( default_quality, default_limit, default_folder ).parse_args() - except KeyError: + except (KeyError, UnicodeDecodeError): arguments = qobuz_dl_args().parse_args() if not arguments.reset: print("Your config file is corrupted! Run 'qobuz-dl -r' to fix this\n") diff --git a/setup.py b/setup.py index 7e5aa3e..0f4aeeb 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ if os.name == "nt": setup( name=pkg_name, - version="0.5.1", + version="0.5.2", author="Vitiko", author_email="vhnz98@gmail.com", description="The complete Lossless and Hi-Res music downloader for Qobuz",