diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-10 12:45:22 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-10 12:45:22 +0100 |
commit | e2b38da93112c97d46d612bf89c329b22ac2d00d (patch) | |
tree | 1bf6d351696e3cff54a3b247f0c842b04dcb1cbc /youtube_dl/extractor/common.py | |
parent | a30a60d8eb027a55ec14c912bad4359b3128997e (diff) |
[mtv] Fixup incorrectly encoded XML documents
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 534908a2b..69a083b68 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -230,9 +230,12 @@ class InfoExtractor(object): return content def _download_xml(self, url_or_request, video_id, - note=u'Downloading XML', errnote=u'Unable to download XML'): + note=u'Downloading XML', errnote=u'Unable to download XML', + transform_source=None): """Return the xml as an xml.etree.ElementTree.Element""" xml_string = self._download_webpage(url_or_request, video_id, note, errnote) + if transform_source: + xml_string = transform_source(xml_string) return xml.etree.ElementTree.fromstring(xml_string.encode('utf-8')) def to_screen(self, msg): |