diff --git a/TIDALDL-PY/tidal_dl/__init__.py b/TIDALDL-PY/tidal_dl/__init__.py index 8907e0d..3beae31 100644 --- a/TIDALDL-PY/tidal_dl/__init__.py +++ b/TIDALDL-PY/tidal_dl/__init__.py @@ -70,6 +70,7 @@ def mainCommand(): def main(): SETTINGS.read(getProfilePath()) TOKEN.read(getTokenPath()) + TIDAL_API.apiKey = apiKey.getItem(SETTINGS.apiKeyIndex) if len(sys.argv) > 1: mainCommand() diff --git a/TIDALDL-PY/tidal_dl/printf.py b/TIDALDL-PY/tidal_dl/printf.py index d2eab00..d4e22a3 100644 --- a/TIDALDL-PY/tidal_dl/printf.py +++ b/TIDALDL-PY/tidal_dl/printf.py @@ -8,6 +8,8 @@ @Contact : yaronhuang@foxmail.com @Desc : ''' +from pickle import GLOBAL +import threading import aigpy import logging import prettytable @@ -36,8 +38,7 @@ __LOGO__ = f''' {VERSION} ''' - - +print_mutex = threading.Lock() class Printf(object): @@ -170,16 +171,25 @@ class Printf(object): @staticmethod def err(string): + global print_mutex + print_mutex.acquire() print(aigpy.cmd.red(LANG.select.PRINT_ERR + " ") + string) # logging.error(string) - + print_mutex.release() + @staticmethod def info(string): + global print_mutex + print_mutex.acquire() print(aigpy.cmd.blue(LANG.select.PRINT_INFO + " ") + string) + print_mutex.release() @staticmethod def success(string): + global print_mutex + print_mutex.acquire() print(aigpy.cmd.green(LANG.select.PRINT_SUCCESS + " ") + string) + print_mutex.release() @staticmethod def album(data: Album): diff --git a/TIDALDL-PY/updatelog.md b/TIDALDL-PY/updatelog.md index 5094370..c04dd27 100644 --- a/TIDALDL-PY/updatelog.md +++ b/TIDALDL-PY/updatelog.md @@ -1,15 +1,17 @@ TYPE tidal-dl USE pip3 install tidal-dl --upgrade +- [X] Fix #931 + #### v2022-07-06 -1. [X] Mulithread download +- [X] Mulithread download #### v2022-06-23 -1. [X] remove redundant configuration -2. [X] add simple-gui -3. [X] optimize code +- [X] remove redundant configuration +- [X] add simple-gui +- [X] optimize code #### v2022-03-04