X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fcommon.py;h=ef02b68966e88d8d1cbc2f9d628e5a79fe8ce3c3;hb=24b8924b469bd1b75bcad82eec3823ad79472610;hp=9653d44eb33db4efb74e97529cdd2aaea0dc1c03;hpb=aafddb2b0a0c6493e5c1e9f92c1570d3c018845b;p=youtube-dl diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 9653d44eb..ef02b6896 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -279,9 +279,12 @@ class InfoExtractor(object): def _download_xml(self, url_or_request, video_id, note=u'Downloading XML', errnote=u'Unable to download XML', - transform_source=None): + transform_source=None, fatal=True): """Return the xml as an xml.etree.ElementTree.Element""" - xml_string = self._download_webpage(url_or_request, video_id, note, errnote) + xml_string = self._download_webpage( + url_or_request, video_id, note, errnote, fatal=fatal) + if xml_string is False: + return xml_string if transform_source: xml_string = transform_source(xml_string) return xml.etree.ElementTree.fromstring(xml_string.encode('utf-8'))