aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorElias Probst <mail@eliasprobst.eu>2014-06-21 01:00:48 +0200
committerElias Probst <mail@eliasprobst.eu>2014-06-21 01:00:48 +0200
commit8bfb6723cb5bd9cb7a4c843e12688b26ab14d17a (patch)
tree56a0a5edc6bede17495b6ba517e992d1d667ad71 /youtube_dl
parenta20575e8aeafeb1aaf70243cce96505b661449e9 (diff)
Extract the base_url for the XML download from the JS snippet's 'server' variable.
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/spiegel.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/spiegel.py b/youtube_dl/extractor/spiegel.py
index 94346daf6..87f1ee694 100644
--- a/youtube_dl/extractor/spiegel.py
+++ b/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))