dropcreations / Manzana-Apple-Music-Downloader

A python program to download albums and songs with AAC codec in .m4a container format and music-videos up to 4K in AVC or HEVC codec in .mp4 format from Apple Music.
https://music.apple.com
GNU General Public License v3.0
205 stars 29 forks source link

ValueError: could not convert string to float: '709m' #35

Open urosch opened 7 months ago

urosch commented 7 months ago

getting this error for this specific url:

https://music.apple.com/si/album/big-thing-deluxe-edition/693604737

[21:47:05] [ManzanaCore] INFO: Fetching API response... ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/manzana.py:83 in │ │ │ │ 80 │ print(LOGO) │ │ 81 │ args = main() │ │ 82 │ config.get_config() │ │ ❱ 83 │ run(args) │ │ 84 │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/control.py:41 in run │ │ │ │ 38 │ │ │ │ 39 │ │ for url in urls: │ │ 40 │ │ │ cons.print(f"\n\t[italic bold]URL: {url}[/]\n") │ │ ❱ 41 │ │ │ data = aplm.get_info(url) │ │ 42 │ │ │ │ │ 43 │ │ │ for sub_data in data: │ │ 44 │ │ │ │ dn = sub_data.get("dir") │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/api/aplm.py:418 in get_info │ │ │ │ 415 │ │ │ 416 │ def get_info(self, url): │ │ 417 │ │ self.parse_url(url) │ │ ❱ 418 │ │ return [self.get_info()] │ │ 419 │ │ │ 420 │ def get_content(self, data): │ │ 421 │ │ id = data.get("id") │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/api/aplm.py:303 in │ │ get_info │ │ │ │ 300 │ │ │ return data │ │ 301 │ │ │ │ 302 │ │ if self.kind == "album": │ │ ❱ 303 │ │ │ data = album.parse_data( │ │ 304 │ │ │ │ self.get_api()["data"][0] │ │ 305 │ │ │ ) │ │ 306 │ │ elif self.kind == "music-video": │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/api/album.py:118 in │ │ parse_data │ │ │ │ 115 │ │ │ if rela["lyrics"].get("data"): │ │ 116 │ │ │ │ if rela["lyrics"]["data"][0].get("attributes"): │ │ 117 │ │ │ │ │ s.update( │ │ ❱ 118 │ │ │ │ │ │ lyrics.parse( │ │ 119 │ │ │ │ │ │ │ rela["lyrics"]["data"][0]["attributes"]["ttml"] │ │ 120 │ │ │ │ │ │ ) │ │ 121 │ │ │ │ │ ) │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/api/lyrics.py:40 in parse │ │ │ │ 37 │ │ else: │ │ 38 │ │ │ b = line.get("begin") │ │ 39 │ │ │ if b: │ │ ❱ 40 │ │ │ │ begin = get_ts(b) │ │ 41 │ │ │ │ timeSyncedLyrics.append(f"[{begin}]{line.text}") │ │ 42 │ │ │ 43 │ return { │ │ │ │ /Users/urosch/Documents/Gitanje/Manzana-Apple-Music-Downloader/core/api/lyrics.py:5 in get_ts │ │ │ │ 2 │ │ 3 def __get_ts(ts): │ │ 4 │ ts = str(ts).replace('s', '') │ │ ❱ 5 │ secs = float(ts.split(':')[-1]) │ │ 6 │ │ │ 7 │ if ":" in ts: │ │ 8 │ │ mins = ts.split(':')[-2] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValueError: could not convert string to float: '709m'

entries from my log file: [24-03-24 21:47:05] [Manzana] INFO: Checking passed urls... [24-03-24 21:47:05] [Manzana] INFO: Starting download process... [24-03-24 21:47:05] [Manzana] DEBUG: Parsing url... [24-03-24 21:47:05] [Manzana] DEBUG: UrlParseResult(kind="album", id="693604737", songId="None") [24-03-24 21:47:05] [Manzana] INFO: Fetching API response... [24-03-24 21:47:05] [Manzana] DEBUG: https://amp-api.music.apple.com:443 "GET /v1/catalog/si/albums/693604737?l=en-GB&extend=editorialVideo&include%5Bsongs%5D=lyrics%2Ccredits HTTP/1.1" 200 None