From 52d35072e68aa23636f869f46eccc7d863c922b0 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Mon, 10 Nov 2025 11:23:52 -0500 Subject: [PATCH] use download_type_str instead --- bcdl.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bcdl.py b/bcdl.py index 8ebb71c7342b1560511b928a738967ae18fadf6f..4ea9288ad5e701870372a082d674768cd8dfae32 100644 --- a/bcdl.py +++ b/bcdl.py @@ -168,14 +168,15 @@ for i,item in enumerate(items): doc = bs4.BeautifulSoup(requests.get(url).text, 'html.parser') pagedata = json.loads(doc.find(id='pagedata')['data-blob']) for n,dlitem in enumerate(pagedata['download_items']): - if dlitem['download_type'] == 'a': + dltype = dlitem['download_type_str'].lower() + if dltype == 'album': filename = clean_filename(f'{dlitem["artist"]} - {dlitem["title"]}')+'.zip' for codec in ['flac','alac','aiff-lossless','wav','mp3-320']: if codec not in dlitem['downloads']: continue download = dlitem['downloads'][codec]['url'] break - elif dlitem['download_type'] == 't': + elif dltype == 'track': filename = clean_filename(f'{dlitem["artist"]} - {dlitem["title"]}')+'.' for codec in ['flac','alac','aiff-lossless','wav','mp3-320']: if codec not in dlitem['downloads']: @@ -184,7 +185,8 @@ for i,item in enumerate(items): filename += codec.split('-')[0] break else: - print(f'Skipping {dlitem["artist"]} - {dlitem["title"]}: unknown type {item["download_type"]}') + print(f'Skipping {dlitem["artist"]} - {dlitem["title"]}: unknown type {dltype}') + print(f'You might want to report this to ~aleteoryx!') skipped += 1 continue filepath = p.joinpath(filename)