diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-11-16 00:51:31 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-11-16 00:51:31 +0100 |
commit | 2707b50ffe540c81629374ea673eea7fb1d1c1a0 (patch) | |
tree | 5e71f88dd6a7f914944858fca4c9fafd1bbdd4f4 /youtube_dl | |
parent | 939fe70de064130330b137da86a11c1f7a78af24 (diff) |
[spiegel] Correct handling of redirects to spiegel.tv (Closes #4211)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/spiegel.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/spiegel.py b/youtube_dl/extractor/spiegel.py index 9586a7da2..1e55a9ffb 100644 --- a/youtube_dl/extractor/spiegel.py +++ b/youtube_dl/extractor/spiegel.py @@ -5,6 +5,7 @@ import re from .common import InfoExtractor from ..compat import compat_urlparse +from .spiegeltv import SpiegeltvIE class SpiegelIE(InfoExtractor): @@ -42,7 +43,11 @@ class SpiegelIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) + webpage, handle = self._download_webpage_handle(url, video_id) + + # 302 to spiegel.tv, like http://www.spiegel.de/video/der-film-zum-wochenende-die-wahrheit-ueber-maenner-video-99003272.html + if SpiegeltvIE.suitable(handle.geturl()): + return self.url_result(handle.geturl(), 'Spiegeltv') title = re.sub(r'\s+', ' ', self._html_search_regex( r'(?s)<(?:h1|div) class="module-title"[^>]*>(.*?)</(?:h1|div)>', |