about summary refs log tree commit diff
path: root/overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch')
-rw-r--r--overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch b/overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch
new file mode 100644
index 000000000000..b5876a477009
--- /dev/null
+++ b/overlays/patches/youtube-dl/0004-bandcamp-fix-the-freeDownloadPage-JSON-lookup-and-us.patch
@@ -0,0 +1,34 @@
+From 848e97dc19218ed59e401fb34e7e2f1d2e40f9da Mon Sep 17 00:00:00 2001
+From: Gilles Pietri <gilles@wolface.fr>
+Date: Sun, 27 Sep 2020 15:11:08 +0200
+Subject: [PATCH 4/8] [bandcamp] fix the freeDownloadPage JSON lookup, and use
+ the id from the URL to match the tracks
+
+From https://github.com/ytdl-org/youtube-dl/pull/26684.
+---
+ youtube_dl/extractor/bandcamp.py | 6 +++---
+ 1 file 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')
+-- 
+2.27.0
+