소스 검색

Extract the base_url for the XML download from the JS snippet's 'server' variable.

Elias Probst 11 년 전
부모
커밋
8bfb6723cb
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      youtube_dl/extractor/spiegel.py

+ 7 - 1
youtube_dl/extractor/spiegel.py

@@ -33,7 +33,13 @@ class SpiegelIE(InfoExtractor):
         video_title = self._html_search_regex(
             r'<div class="module-title">(.*?)</div>', webpage, 'title')
 
-        xml_url = 'http://video2.spiegel.de/flash/' + video_id + '.xml'
+        base_url = self._search_regex(
+            r'var\s+server\s+=\s+\"(http://video\d*\.spiegel\.de/flash/\d+/\d+/)\";',
+            webpage,
+            'base_url',
+        )
+
+        xml_url = base_url + video_id + '.xml'
         idoc = self._download_xml(
             xml_url, video_id,
             note='Downloading XML', errnote='Failed to download XML from "{0}"'.format(xml_url))