1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-25 09:54:32 +01:00

Merge branch 'bandcamp_update' of https://github.com/gilou/youtube-dl into gilou-bandcamp_update

This commit is contained in:
Lyz 2020-09-24 11:05:27 +02:00
commit dfbdd74205
No known key found for this signature in database
GPG Key ID: 6C7D7C1612CDE02F

View File

@ -91,10 +91,11 @@ class BandcampIE(InfoExtractor):
duration = None duration = None
formats = [] formats = []
track_info = self._parse_json( trackinfo_block = self._search_regex(
self._search_regex( r'trackinfo":\[\s*({.+?})\s*\],"',
r'trackinfo\s*:\s*\[\s*({.+?})\s*\]\s*,\s*?\n', webpage, 'track info', default='{}')
webpage, 'track info', default='{}'), title) quoted_json = trackinfo_block.replace('"', '"')
track_info = self._parse_json(quoted_json, title)
if track_info: if track_info:
file_ = track_info.get('file') file_ = track_info.get('file')
if isinstance(file_, dict): if isinstance(file_, dict):
@ -117,7 +118,7 @@ class BandcampIE(InfoExtractor):
def extract(key): def extract(key):
return self._search_regex( return self._search_regex(
r'\b%s\s*["\']?\s*:\s*(["\'])(?P<value>(?:(?!\1).)+)\1' % key, r',&quot;%s&quot;:(&quot;)(?P<value>(?:(?!&quot;).)+)&quot;' % key,
webpage, key, default=None, group='value') webpage, key, default=None, group='value')
artist = extract('artist') artist = extract('artist')