diff options
author | Gilles Pietri <gilles@wolface.fr> | 2020-09-27 15:11:08 +0200 |
---|---|---|
committer | Gilles Pietri <gilles@wolface.fr> | 2020-09-27 15:11:08 +0200 |
commit | 9385ec4b1c797ffab66b945f23fd4248c0c8a32e (patch) | |
tree | 7a2b27cf1f5461e0e8d69ac559f75d59cf15cc25 | |
parent | f43a856334b633e3d2f778b455fb08a4a06fbf51 (diff) | |
download | hypervideo-pre-9385ec4b1c797ffab66b945f23fd4248c0c8a32e.tar.lz hypervideo-pre-9385ec4b1c797ffab66b945f23fd4248c0c8a32e.tar.xz hypervideo-pre-9385ec4b1c797ffab66b945f23fd4248c0c8a32e.zip |
[bandcamp] fix the freeDownloadPage JSON lookup, and use the id from the URL to match the tracks
-rw-r--r-- | youtube_dl/extractor/bandcamp.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index f036a89eb..eccb867a0 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -128,12 +128,12 @@ class BandcampIE(InfoExtractor): release_date = unified_strdate(extract('album_release_date')) download_link = self._search_regex( - r'freeDownloadPage\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, + r'freeDownloadPage(?:["\']|"):\s*(["\']|")(?P<url>(?:(?!\1).)+)\1', webpage, 'download link', default=None, group='url') if download_link: track_id = self._search_regex( - r'(?ms)var TralbumData = .*?[{,]\s*id: (?P<id>\d+),?$', - webpage, 'track id') + r'\?id=(?P<id>\d+)&', + download_link, 'track id') download_webpage = self._download_webpage( download_link, track_id, 'Downloading free downloads page') |