From 1a789195958d3a9edabc93b9befb68ca57e30983 Mon Sep 17 00:00:00 2001 From: Lyz Date: Fri, 25 Oct 2019 15:10:44 +0200 Subject: [PATCH 1/4] * Update extractor to match changes --- youtube_dl/extractor/bandcamp.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index f14b407dc..f1a047f57 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -34,6 +34,9 @@ class BandcampIE(InfoExtractor): 'id': '1812978515', 'ext': 'mp3', 'title': "youtube-dl \"'/\\\u00e4\u21ad - youtube-dl test song \"'/\\\u00e4\u21ad", + 'timestamp': 1354224127, + 'uploader': 'youtube-dl \\"\'/\\\\ä↭', + 'upload_date': '20121129', 'duration': 9.8485, }, '_skip': 'There is a limit of 200 free downloads / month for the test song' @@ -117,8 +120,9 @@ class BandcampIE(InfoExtractor): def extract(key): return self._search_regex( - r'\b%s\s*["\']?\s*:\s*(["\'])(?P(?:(?!\1).)+)\1' % key, - webpage, key, default=None, group='value') + r'\b%s\s*["\']?\s*:\s*(["\'])(?P.+)\1' % key, + webpage, key, default=None, group='value' + ) artist = extract('artist') album = extract('album_title') @@ -195,7 +199,7 @@ class BandcampIE(InfoExtractor): self._sort_formats(formats) - title = '%s - %s' % (artist, track) if artist else track + title = '%s - %s' % (artist, track) if not re.match(artist, track) else track if not duration: duration = float_or_none(self._html_search_meta( From f424a20b90089f5a3d638e2ec497144603df5c12 Mon Sep 17 00:00:00 2001 From: Lyz Date: Fri, 25 Oct 2019 15:21:25 +0200 Subject: [PATCH 2/4] Fix code styling --- youtube_dl/extractor/bandcamp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index f1a047f57..00abc5430 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -121,8 +121,7 @@ class BandcampIE(InfoExtractor): def extract(key): return self._search_regex( r'\b%s\s*["\']?\s*:\s*(["\'])(?P.+)\1' % key, - webpage, key, default=None, group='value' - ) + webpage, key, default=None, group='value') artist = extract('artist') album = extract('album_title') From 868586835e9bb06420af211dafb31f722e70f24b Mon Sep 17 00:00:00 2001 From: Lyz Date: Fri, 25 Oct 2019 17:43:53 +0200 Subject: [PATCH 3/4] Fix unicode weird characters --- youtube_dl/extractor/bandcamp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index 00abc5430..90d1e5558 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -35,7 +35,7 @@ class BandcampIE(InfoExtractor): 'ext': 'mp3', 'title': "youtube-dl \"'/\\\u00e4\u21ad - youtube-dl test song \"'/\\\u00e4\u21ad", 'timestamp': 1354224127, - 'uploader': 'youtube-dl \\"\'/\\\\ä↭', + 'uploader': 'youtube-dl \\"\'/\\\\\u00e4\u21ad', 'upload_date': '20121129', 'duration': 9.8485, }, From c5fc9292151472ea99c055e859412cce7c8e5d1c Mon Sep 17 00:00:00 2001 From: Lyz Date: Thu, 7 Nov 2019 16:44:17 +0100 Subject: [PATCH 4/4] Fix regexp --- youtube_dl/extractor/bandcamp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index 90d1e5558..7d3daff7a 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -120,7 +120,7 @@ class BandcampIE(InfoExtractor): def extract(key): return self._search_regex( - r'\b%s\s*["\']?\s*:\s*(["\'])(?P.+)\1' % key, + r'\b%s\s*["\']?\s*:\s*(["\'])(?P(?:(?!\1)).+)\1' % key, webpage, key, default=None, group='value') artist = extract('artist')