]> jfr.im git - yt-dlp.git/commitdiff
[bandcamp] fix the freeDownloadPage JSON lookup, and use the id from the URL to match...
authorGilles Pietri <redacted>
Sun, 27 Sep 2020 13:11:08 +0000 (15:11 +0200)
committerGilles Pietri <redacted>
Sun, 27 Sep 2020 13:11:08 +0000 (15:11 +0200)
youtube_dl/extractor/bandcamp.py

index f036a89ebd9d87182d6116fdbd6e9fd51fdac283..eccb867a0db5de08be05cfce97747ec1e19e9f23 100644 (file)
@@ -128,12 +128,12 @@ def extract(key):
         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')