From 87e83e807f78e08392bedf35bf4eb72cc4e52f6b Mon Sep 17 00:00:00 2001 From: RemixDev Date: Wed, 4 Aug 2021 21:36:34 +0200 Subject: [PATCH] Fixed download oversight --- deemix/downloader.py | 4 ++-- deemix/types/DownloadObjects.py | 2 +- deemix/utils/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deemix/downloader.py b/deemix/downloader.py index a2a095e..947a35e 100644 --- a/deemix/downloader.py +++ b/deemix/downloader.py @@ -129,6 +129,7 @@ def getPreferredBitrate(dz, track, preferredBitrate, shouldFallback, uuid=None, def getCorrectURL(track, formatName, formatNumber): nonlocal wrongLicense, isGeolocked + url = None # Check the track with the legit method try: url = dz.get_track_url(track.trackToken, formatName) @@ -441,10 +442,9 @@ class Downloader: def downloadWrapper(self, extraData, track=None): trackAPI_gw = extraData['trackAPI_gw'] - if '_EXTRA_TRACK' in trackAPI_gw: + if trackAPI_gw.get('_EXTRA_TRACK'): extraData['trackAPI'] = trackAPI_gw['_EXTRA_TRACK'].copy() del extraData['trackAPI_gw']['_EXTRA_TRACK'] - del trackAPI_gw['_EXTRA_TRACK'] # Temp metadata to generate logs itemData = { 'id': trackAPI_gw['SNG_ID'], diff --git a/deemix/types/DownloadObjects.py b/deemix/types/DownloadObjects.py index aeec2b0..a09cf57 100644 --- a/deemix/types/DownloadObjects.py +++ b/deemix/types/DownloadObjects.py @@ -16,7 +16,7 @@ class IDownloadObject: self.progress = obj.get('progress', 0) self.errors = obj.get('errors', []) self.files = obj.get('files', []) - self.extrasPath = obj.get('extrasPath') + self.extrasPath = obj.get('extrasPath', "") if self.extrasPath: self.extrasPath = Path(self.extrasPath) self.progressNext = 0 self.uuid = f"{self.type}_{self.id}_{self.bitrate}" diff --git a/deemix/utils/__init__.py b/deemix/utils/__init__.py index 8242299..5bbd132 100644 --- a/deemix/utils/__init__.py +++ b/deemix/utils/__init__.py @@ -128,5 +128,5 @@ def formatListener(key, data=None): if key == "startConversion": return f"[{data}] Started converting" if key == "finishConversion": - return f"[{data}] Finished converting" + return f"[{data['uuid']}] Finished converting" return "" diff --git a/setup.py b/setup.py index c128924..2e09e9b 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( python_requires='>=3.7', packages=find_packages(exclude=("tests",)), include_package_data=True, - install_requires=["click", "pycryptodomex", "mutagen", "requests", "spotipy>=2.11.0", "deezer-py>=1.1.1"], + install_requires=["click", "pycryptodomex", "mutagen", "requests", "spotipy>=2.11.0", "deezer-py>=1.1.2"], entry_points={ "console_scripts": [ "deemix=deemix.__main__:download",