From 3ca8c223150a289f57594da5447c2c59b5eeb4a4 Mon Sep 17 00:00:00 2001 From: gkoelln Date: Thu, 26 Jan 2017 10:28:00 -0600 Subject: [PATCH] [bandcamp] add extracted fields Fixed what I broke in the id fields --- youtube_dl/extractor/bandcamp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index 8fbadc644..3b2e482ff 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -62,7 +62,8 @@ class BandcampIE(InfoExtractor): if m_trackinfo: json_code = m_trackinfo.group(1) data = json.loads(json_code)[0] - + track_id = compat_str(data['id']) + if not data.get('file'): raise ExtractorError('Not streamable', video_id=track_id, expected=True) @@ -87,7 +88,7 @@ class BandcampIE(InfoExtractor): 'duration': float_or_none(data.get('duration')), 'track': data.get('title'), 'track_number': data.get('track_num'), - 'track_id': data.get('id'), + 'track_id': track_id, 'album': album, 'album_artist': album_artist, 'release_year': release_year,