Skip to content

Commit

Permalink
[bandcamp] Revert test song title, and extract title generally (which…
Browse files Browse the repository at this point in the history
… may fail, as the other title json values might come up), instead of out of trackinfo, as bandcamp prefixes it with artist -
  • Loading branch information
gilou committed Sep 29, 2020
1 parent 75a83af commit 03edd54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions youtube_dl/extractor/bandcamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -99,7 +99,6 @@ def _real_extract(self, url):
webpage, 'track info', default='{}')

track_info = self._parse_json(trackinfo_block, title)

if track_info:
file_ = track_info.get('file')
if isinstance(file_, dict):
Expand All @@ -115,7 +114,7 @@ def _real_extract(self, url):
'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'))
Expand All @@ -126,6 +125,7 @@ def extract(key):
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(
Expand Down

0 comments on commit 03edd54

Please sign in to comment.