Browse Source

Merge pull request 'Rebase with upstream' (#1) from RemixDev/deemix-py:main into main

Reviewed-on: https://git.freezerapp.xyz/omtinez/deemix-py/pulls/1
main
omtinez 6 months ago
parent
commit
7fe430b77f
4 changed files with 14 additions and 11 deletions
  1. +1
    -1
      deemix/__init__.py
  2. +1
    -1
      deemix/types/Album.py
  3. +11
    -8
      deemix/utils/__init__.py
  4. +1
    -1
      setup.py

+ 1
- 1
deemix/__init__.py View File

@ -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):


+ 1
- 1
deemix/types/Album.py View File

@ -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'):


+ 11
- 8
deemix/utils/__init__.py View File

@ -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()
@ -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


+ 1
- 1
setup.py View File

@ -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",


Loading…
Cancel
Save