From 3aa1389eed03df06cada8cf3c1964b9d5761167c Mon Sep 17 00:00:00 2001 From: RemixDev Date: Wed, 29 Dec 2021 17:42:45 +0100 Subject: [PATCH 1/4] fixed album art not downloading --- deemix/types/Album.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deemix/types/Album.py b/deemix/types/Album.py index e95dae4..9fee6f1 100644 --- a/deemix/types/Album.py +++ b/deemix/types/Album.py @@ -94,7 +94,7 @@ class Album: self.discTotal = albumAPI.get('nb_disk', "1") self.copyright = albumAPI.get('copyright', "") - if self.pic.md5 == "": + if not self.pic.md5 or self.pic.md5 == "": if albumAPI.get('md5_image'): self.pic.md5 = albumAPI['md5_image'] elif albumAPI.get('cover_small'): From b983712086d3a2a9602e6946e19754e513fb73c4 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Wed, 29 Dec 2021 17:48:14 +0100 Subject: [PATCH 2/4] v3.6.4 --- deemix/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deemix/__init__.py b/deemix/__init__.py index 5444f12..c27354f 100644 --- a/deemix/__init__.py +++ b/deemix/__init__.py @@ -10,7 +10,7 @@ from deemix.itemgen import generateTrackItem, \ generateArtistTopItem from deemix.errors import LinkNotRecognized, LinkNotSupported -__version__ = "3.6.3" +__version__ = "3.6.4" # Returns the Resolved URL, the Type and the ID def parseLink(link): diff --git a/setup.py b/setup.py index 49400f4..87af2dc 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="3.6.3", + version="3.6.4", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown", From 1863557f49c8eb3a2de407d684b348bc32729d22 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 2 Jan 2022 13:53:00 +0100 Subject: [PATCH 3/4] fixed feat removal issue --- deemix/utils/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/deemix/utils/__init__.py b/deemix/utils/__init__.py index cfb4e64..c9ff6d9 100644 --- a/deemix/utils/__init__.py +++ b/deemix/utils/__init__.py @@ -50,17 +50,20 @@ def removeFeatures(title): clean = title found = False pos = -1 - if re.search(r"[\s(]?feat\.?\s", clean): - pos = re.search(r"[\s(]?feat\.?\s", clean).start(0) + if re.search(r"[\s(]\(?\s?feat\.?\s", clean): + pos = re.search(r"[\s(]\(?\s?feat\.?\s", clean).start(0) found = True - if re.search(r"[\s(]?ft\.?\s", clean): - pos = re.search(r"[\s(]?ft\.?\s", clean).start(0) + if re.search(r"[\s(]\(?\s?ft\.?\s", clean): + pos = re.search(r"[\s(]\(?\s?ft\.?\s", clean).start(0) found = True - openBracket = clean[pos] == '(' + openBracket = clean[pos] == '(' or clean[pos+1] == '(' + otherBracket = clean.find('(', pos+2) if found: tempTrack = clean[:pos] if ")" in clean and openBracket: - tempTrack += clean[clean.find(")", pos + 1) + 1:] + tempTrack += clean[clean.find(")", pos+2) + 1:] + if not openBracket and otherBracket != -1: + tempTrack += f" {clean[otherBracket:]}" clean = tempTrack.strip() clean = ' '.join(clean.split()) return clean From 27219d06986d539ff8ad67cbf2ffd11d18d6797a Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 2 Jan 2022 14:14:57 +0100 Subject: [PATCH 4/4] fixed changeCase for strings with trailing whitespace --- deemix/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deemix/utils/__init__.py b/deemix/utils/__init__.py index c9ff6d9..ff46ce6 100644 --- a/deemix/utils/__init__.py +++ b/deemix/utils/__init__.py @@ -35,9 +35,9 @@ def changeCase(txt, case_type): if case_type == "upper": return txt.upper() if case_type == "start": - txt = txt.split(" ") + txt = txt.strip().split(" ") for i, word in enumerate(txt): - if word[0] in ['(', '{', '[']: + if word[0] in ['(', '{', '[', "'", '"']: txt[i] = word[0] + word[1:].capitalize() else: txt[i] = word.capitalize()