From 61241abbb0ea2c515765fd8f1fc25379788a0d42 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 11 May 2021 12:59:45 +0530 Subject: [PATCH] [generic] Respect the encoding in manifest --- yt_dlp/extractor/generic.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py index 32815476f..2153fe6b3 100644 --- a/yt_dlp/extractor/generic.py +++ b/yt_dlp/extractor/generic.py @@ -2508,7 +2508,10 @@ class GenericIE(InfoExtractor): # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest? try: - doc = compat_etree_fromstring(webpage.encode('utf-8')) + try: + doc = compat_etree_fromstring(webpage) + except compat_xml_parse_error: + doc = compat_etree_fromstring(webpage.encode('utf-8')) if doc.tag == 'rss': return self._extract_rss(url, video_id, doc) elif doc.tag == 'SmoothStreamingMedia':