[generic] Respect the encoding in manifest

This commit is contained in:
pukkandan 2021-05-11 12:59:45 +05:30
parent 53ed7066ab
commit 61241abbb0
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -2508,6 +2508,9 @@ def _real_extract(self, url):
# Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest? # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest?
try: try:
try:
doc = compat_etree_fromstring(webpage)
except compat_xml_parse_error:
doc = compat_etree_fromstring(webpage.encode('utf-8')) doc = compat_etree_fromstring(webpage.encode('utf-8'))
if doc.tag == 'rss': if doc.tag == 'rss':
return self._extract_rss(url, video_id, doc) return self._extract_rss(url, video_id, doc)