aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Pietri <gilles@wolface.fr>2020-09-27 15:11:08 +0200
committerGilles Pietri <gilles@wolface.fr>2020-09-27 15:11:08 +0200
commit9385ec4b1c797ffab66b945f23fd4248c0c8a32e (patch)
tree7a2b27cf1f5461e0e8d69ac559f75d59cf15cc25
parentf43a856334b633e3d2f778b455fb08a4a06fbf51 (diff)
downloadhypervideo-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.py6
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(?:["\']|&quot;):\s*(["\']|&quot;)(?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')