From fe2eafae4bfc901d2760aef9d4cc6db60528b4b4 Mon Sep 17 00:00:00 2001 From: AnthonyF Date: Wed, 18 May 2022 11:54:02 -0400 Subject: [PATCH] Add another fallback date for tracks In some cases a track may not have an album release or track release date, in this case fallback to when the track was first added to Bandcamp. --- bandcamp_dl/bandcamp.py | 2 ++ requirements.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bandcamp_dl/bandcamp.py b/bandcamp_dl/bandcamp.py index 2c4dcef..e5100b3 100644 --- a/bandcamp_dl/bandcamp.py +++ b/bandcamp_dl/bandcamp.py @@ -51,6 +51,8 @@ class Bandcamp: album_release = page_json['album_release_date'] if album_release is None: album_release = page_json['current']['release_date'] + if album_release is None: + album_release = page_json['embed_info']['item_public'] try: album_title = page_json['current']['title'] diff --git a/requirements.txt b/requirements.txt index 72c916b..1a5e0c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ --index-url https://pypi.python.org/simple/ -beautifulsoup4==4.10.0 +beautifulsoup4==4.11.1 demjson3==3.0.5 docopt==0.6.2 mutagen==1.45.1 -requests==2.26.0 +requests==2.27.1 unicode-slugify==0.1.5 mock==4.0.3 chardet==4.0.0