mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-18 18:36:00 -05:00
[bandcamp] use unescapeHTML instead of a simple replace of quotes
This commit is contained in:
parent
9c1f99402f
commit
14194392a8
@ -92,10 +92,10 @@ class BandcampIE(InfoExtractor):
|
|||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
trackinfo_block = self._search_regex(
|
trackinfo_block = self._search_regex(
|
||||||
r'trackinfo":\[\s*({.+?})\s*\],"',
|
r'trackinfo(?:["\']|"):\[\s*({.+?})\s*\],(?:["\']|")',
|
||||||
webpage, 'track info', default='{}')
|
webpage, 'track info', default='{}')
|
||||||
quoted_json = trackinfo_block.replace('"', '"')
|
unescaped_json = unescapeHTML(trackinfo_block)
|
||||||
track_info = self._parse_json(quoted_json, title)
|
track_info = self._parse_json(unescaped_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):
|
||||||
@ -118,7 +118,7 @@ class BandcampIE(InfoExtractor):
|
|||||||
|
|
||||||
def extract(key):
|
def extract(key):
|
||||||
return self._search_regex(
|
return self._search_regex(
|
||||||
r',"%s":(")(?P<value>(?:(?!").)+)"' % key,
|
r',(["\']|")%s\1:\1(?P<value>(?:(?!\1).)+)\1' % key,
|
||||||
webpage, key, default=None, group='value')
|
webpage, key, default=None, group='value')
|
||||||
|
|
||||||
artist = extract('artist')
|
artist = extract('artist')
|
||||||
|
Loading…
Reference in New Issue
Block a user