mirror of
https://github.com/Wojtek242/qobuz-dl.git
synced 2024-11-22 11:05:25 +01:00
Remove awful function
This commit is contained in:
parent
835f84e2c5
commit
f68fadea11
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,7 +4,7 @@ Qobuz Downloads
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
.bumpversion.cfg
|
||||||
/*.py
|
/*.py
|
||||||
!/setup.py
|
!/setup.py
|
||||||
|
|
||||||
|
@ -23,14 +23,7 @@ def tqdm_download(url, fname, track_name):
|
|||||||
bar.update(size)
|
bar.update(size)
|
||||||
|
|
||||||
|
|
||||||
def mkDir(dirn):
|
def get_description(u, mt, multiple=None):
|
||||||
try:
|
|
||||||
os.makedirs(dirn, exist_ok=True)
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def getDesc(u, mt, multiple=None):
|
|
||||||
return "{} [{}/{}]".format(
|
return "{} [{}/{}]".format(
|
||||||
("[Disc {}] {}".format(multiple, mt["title"])) if multiple else mt["title"],
|
("[Disc {}] {}".format(multiple, mt["title"])) if multiple else mt["title"],
|
||||||
u["bit_depth"],
|
u["bit_depth"],
|
||||||
@ -126,7 +119,7 @@ def download_and_tag(
|
|||||||
|
|
||||||
if multiple:
|
if multiple:
|
||||||
root_dir = os.path.join(root_dir, "Disc " + str(multiple))
|
root_dir = os.path.join(root_dir, "Disc " + str(multiple))
|
||||||
mkDir(root_dir)
|
os.makedirs(root_dir, exist_ok=True)
|
||||||
|
|
||||||
filename = os.path.join(root_dir, ".{:02}".format(tmp_count) + extension)
|
filename = os.path.join(root_dir, ".{:02}".format(tmp_count) + extension)
|
||||||
|
|
||||||
@ -139,7 +132,7 @@ def download_and_tag(
|
|||||||
print(track_metadata["title"] + " was already downloaded. Skipping...")
|
print(track_metadata["title"] + " was already downloaded. Skipping...")
|
||||||
return
|
return
|
||||||
|
|
||||||
desc = getDesc(track_url_dict, track_metadata, multiple)
|
desc = get_description(track_url_dict, track_metadata, multiple)
|
||||||
tqdm_download(url, filename, desc)
|
tqdm_download(url, filename, desc)
|
||||||
tag_function = metadata.tag_mp3 if is_mp3 else metadata.tag_flac
|
tag_function = metadata.tag_mp3 if is_mp3 else metadata.tag_flac
|
||||||
try:
|
try:
|
||||||
@ -193,7 +186,7 @@ def download_id_by_type(
|
|||||||
)
|
)
|
||||||
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
|
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
|
||||||
dirn = os.path.join(path, sanitized_title)
|
dirn = os.path.join(path, sanitized_title)
|
||||||
mkDir(dirn)
|
os.makedirs(dirn, exist_ok=True)
|
||||||
get_extra(meta["image"]["large"], dirn)
|
get_extra(meta["image"]["large"], dirn)
|
||||||
if "goodies" in meta:
|
if "goodies" in meta:
|
||||||
try:
|
try:
|
||||||
@ -235,7 +228,7 @@ def download_id_by_type(
|
|||||||
)
|
)
|
||||||
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
|
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
|
||||||
dirn = os.path.join(path, sanitized_title)
|
dirn = os.path.join(path, sanitized_title)
|
||||||
mkDir(dirn)
|
os.makedirs(dirn, exist_ok=True)
|
||||||
get_extra(meta["album"]["image"]["large"], dirn)
|
get_extra(meta["album"]["image"]["large"], dirn)
|
||||||
is_mp3 = True if int(quality) == 5 else False
|
is_mp3 = True if int(quality) == 5 else False
|
||||||
download_and_tag(dirn, count, parse, meta, meta, True, is_mp3, embed_art)
|
download_and_tag(dirn, count, parse, meta, meta, True, is_mp3, embed_art)
|
||||||
|
2
setup.py
2
setup.py
@ -13,7 +13,7 @@ requirements = read_file("requirements.txt").strip().split()
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=pkg_name,
|
name=pkg_name,
|
||||||
version="0.5.5.2",
|
version="0.5.5.3",
|
||||||
author="Vitiko",
|
author="Vitiko",
|
||||||
author_email="vhnz98@gmail.com",
|
author_email="vhnz98@gmail.com",
|
||||||
description="The complete Lossless and Hi-Res music downloader for Qobuz",
|
description="The complete Lossless and Hi-Res music downloader for Qobuz",
|
||||||
|
Loading…
Reference in New Issue
Block a user