about summary refs log tree commit diff
path: root/overlays/patches/youtube-dl/0007-bandcamp-Revert-test-song-title-and-extract-title-ge.patch
blob: b30a7c0d24d535b344fece81ecd6e8b1facda487 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From ab8820258115866f1c5f8955131a7e88ee178662 Mon Sep 17 00:00:00 2001
From: Gilles Pietri <gilles@wolface.fr>
Date: Tue, 29 Sep 2020 12:09:55 +0200
Subject: [PATCH 7/8] [bandcamp] Revert test song title, and extract title
 generally (which may fail, as the other title json values might come up),
 instead of out of trackinfo, as bandcamp prefixes it with artist -

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 3405b570a..04b8aa80f 100644
--- a/youtube_dl/extractor/bandcamp.py
+++ b/youtube_dl/extractor/bandcamp.py
@@ -33,7 +33,7 @@ class BandcampIE(InfoExtractor):
         'info_dict': {
             'id': '1812978515',
             'ext': 'mp3',
-            'title': "youtube-dl  \"'/\\\u00e4\u21ad - youtube-dl  \"'/\\\u00e4\u21ad - youtube-dl test song \"'/\\\u00e4\u21ad",
+            'title': "youtube-dl  \"'/\\\u00e4\u21ad - youtube-dl test song \"'/\\\u00e4\u21ad",
             'duration': 9.8485,
             'uploader': "youtube-dl  \"'/\\\u00e4\u21ad",
             'timestamp': 1354224127,
@@ -99,7 +99,6 @@ class BandcampIE(InfoExtractor):
             webpage, 'track info', default='{}')
 
         track_info = self._parse_json(trackinfo_block, title)
-
         if track_info:
             file_ = track_info.get('file')
             if isinstance(file_, dict):
@@ -115,7 +114,7 @@ class BandcampIE(InfoExtractor):
                         'acodec': ext,
                         'abr': int_or_none(abr_str),
                     })
-            track = track_info.get('title')
+
             track_id = str_or_none(track_info.get('track_id') or track_info.get('id'))
             track_number = int_or_none(track_info.get('track_num'))
             duration = float_or_none(track_info.get('duration'))
@@ -126,6 +125,7 @@ class BandcampIE(InfoExtractor):
                 webpage, key, default=None, group='value')
             return data.replace(r'\"', '"').replace('\\\\', '\\') if data else data
 
+        track = extract('title')
         artist = extract('artist')
         album = extract('album_title')
         timestamp = unified_timestamp(
-- 
2.27.0