projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a20575e
)
Extract the base_url for the XML download from the JS snippet's 'server' variable.
author
Elias Probst
<mail@eliasprobst.eu>
Fri, 20 Jun 2014 23:00:48 +0000
(
01:00
+0200)
committer
Elias Probst
<mail@eliasprobst.eu>
Fri, 20 Jun 2014 23:00:48 +0000
(
01:00
+0200)
youtube_dl/extractor/spiegel.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/spiegel.py
b/youtube_dl/extractor/spiegel.py
index 94346daf6cc4ae1a09a05a8524ea3b3beccca672..87f1ee69462600f57c0bde46784307cb6e3e0963 100644
(file)
--- 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')
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))
idoc = self._download_xml(
xml_url, video_id,
note='Downloading XML', errnote='Failed to download XML from "{0}"'.format(xml_url))