mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-21 13:54:22 -07:00
[mtv] Fixup incorrectly encoded XML documents
This commit is contained in:
parent
a30a60d8eb
commit
e2b38da931
2 changed files with 11 additions and 3 deletions
|
@ -82,8 +82,13 @@ class MTVServicesInfoExtractor(InfoExtractor):
|
|||
def _get_videos_info(self, uri):
|
||||
video_id = self._id_from_uri(uri)
|
||||
data = compat_urllib_parse.urlencode({'uri': uri})
|
||||
idoc = self._download_xml(self._FEED_URL +'?' + data, video_id,
|
||||
u'Downloading info')
|
||||
|
||||
def fix_ampersand(s):
|
||||
""" Fix unencoded ampersand in XML """
|
||||
return s.replace(u'& ', '& ')
|
||||
idoc = self._download_xml(
|
||||
self._FEED_URL + '?' + data, video_id,
|
||||
u'Downloading info', transform_source=fix_ampersand)
|
||||
return [self._get_video_info(item) for item in idoc.findall('.//item')]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue