From 2792a7c0410771fff1d06f6a8e88d047642e2397 Mon Sep 17 00:00:00 2001 From: lars Date: Mon, 24 Oct 2022 13:13:48 +0200 Subject: [PATCH] fixed runtime error if download from musify --- src/__pycache__/musify.cpython-310.pyc | Bin 1837 -> 1831 bytes src/musify.py | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/__pycache__/musify.cpython-310.pyc b/src/__pycache__/musify.cpython-310.pyc index 955cadfb60a46ce2512b84fd5e5f37b9e347bb03..efb61555d93deffeababf8baa5db8312f5c47018 100644 GIT binary patch delta 264 zcmZ3>x15hRpO=@50SJtX!;;lD@>(-7ica=qI>^YqnVZ>&kx_cG9g9Rg6G#OVumEWe zAa(}g;$=Xhgkb?=3S$l9Y=#u3xy%b085v5L7BJT^E@Z4_s$t4vNny@rE;0nOShAUl zlz{44!Kzv3GJ#a5umv-eu%)nr#W+CffF^MQY4+I+bJ?01n;3;kIBFPDxSE;z`D&SK zm=^#gCqHMo&B!wOB&$86#$--5c}By@nrto{`at(+G8P$5E@jgdGzGbk4M=b>axii+ c78y<6%x1=B2owM^-?N#svvCM;@bd5i00~Vs8vp-?Nw?Yt(39KCSH-x0mFMGCBiBe{An zYU1A%WlM2FaraD;vkD#spE1u%F$Y-AD^c({CZZ5G(ubR_ZAp(amiEA5Hm_o5(^|)C}M9%cxIzdzoK{4|Tk;U7xc;(nZwx z5+wSF;jsSec$S7OeQNg!*adyYdT)79k7yDLOC#AZEc8J;r9w8Wr4=4@FL2X0%64oV F$A4S7I;8*r diff --git a/src/musify.py b/src/musify.py index e2337c5..8a96600 100644 --- a/src/musify.py +++ b/src/musify.py @@ -7,6 +7,7 @@ session.headers = { "Referer": "https://musify.club/" } + def get_musify_url(row): title = row['title'] artists = row['artist'] @@ -22,6 +23,7 @@ def get_musify_url(row): return None + def get_download_link(default_url): # https://musify.club/track/dl/18567672/rauw-alejandro-te-felicito-feat-shakira.mp3 # /track/sundenklang-wenn-mein-herz-schreit-3883217' @@ -34,7 +36,8 @@ def get_download_link(default_url): return f"https://musify.club/track/dl/{musify_id}/{musify_name}.mp3" -def download_from_musify(path, file, url): + +def download_from_musify(file, url): logging.info(f"downloading: '{url}'") r = session.get(url) if r.status_code != 200: @@ -46,6 +49,7 @@ def download_from_musify(path, file, url): mp3_file.write(r.content) logging.info("finished") + def download(row): url = row['url'] file_ = row['file']