From: Yen Chi Hsuan Date: Sat, 16 Apr 2016 11:11:25 +0000 (+0800) Subject: [tudou] Improve error detection (closes #9175) X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=bec47a0748e11cfd2e92f6c9c3f71347dc6ed2f8;p=youtube-dl [tudou] Improve error detection (closes #9175) --- diff --git a/youtube_dl/extractor/tudou.py b/youtube_dl/extractor/tudou.py index 63b5d5924..bb8b8e234 100644 --- a/youtube_dl/extractor/tudou.py +++ b/youtube_dl/extractor/tudou.py @@ -65,6 +65,9 @@ class TudouIE(InfoExtractor): if quality: info_url += '&hd' + quality xml_data = self._download_xml(info_url, video_id, 'Opening the info XML page') + error = xml_data.attrib.get('error') + if error is not None: + raise ExtractorError('Tudou said: %s' % error, expected=True) final_url = xml_data.text return final_url