소스 검색

[tudou] Improve error detection (closes #9175)

Yen Chi Hsuan 9 년 전
부모
커밋
bec47a0748
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      youtube_dl/extractor/tudou.py

+ 3 - 0
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