about summary refs log tree commit diff
path: root/youtube_dl/extractor/eagleplatform.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-04-25 22:48:17 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-04-25 22:48:17 +0800
commit4645432d7a92bfb950571dde5dd690110e0f2284 (patch)
tree2113c42943a53f021a5ef2c3a6b5cd3d76f60bb0 /youtube_dl/extractor/eagleplatform.py
parent6bdc2d5358c2843e3be4d073b2005e5196519664 (diff)
downloadyoutube-dl-4645432d7a92bfb950571dde5dd690110e0f2284.tar.gz
youtube-dl-4645432d7a92bfb950571dde5dd690110e0f2284.tar.xz
youtube-dl-4645432d7a92bfb950571dde5dd690110e0f2284.zip
[eagleplatform] Checking direct HTTP links
Sometimes they fail with 404
Diffstat (limited to 'youtube_dl/extractor/eagleplatform.py')
-rw-r--r--youtube_dl/extractor/eagleplatform.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/eagleplatform.py b/youtube_dl/extractor/eagleplatform.py
index 0f8c73fd7..113a4966f 100644
--- a/youtube_dl/extractor/eagleplatform.py
+++ b/youtube_dl/extractor/eagleplatform.py
@@ -23,7 +23,7 @@ class EaglePlatformIE(InfoExtractor):
     _TESTS = [{
         # http://lenta.ru/news/2015/03/06/navalny/
         'url': 'http://lentaru.media.eagleplatform.com/index/player?player=new&record_id=227304&player_template_id=5201',
-        'md5': '881ee8460e1b7735a8be938e2ffb362b',
+        # Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
         'info_dict': {
             'id': '227304',
             'ext': 'mp4',
@@ -109,8 +109,11 @@ class EaglePlatformIE(InfoExtractor):
             mobj = re.search('/([^/]+)/index\.m3u8', m3u8_format['url'])
             if mobj:
                 http_format = m3u8_format.copy()
+                video_url = mp4_url.replace(mp4_url_basename, mobj.group(1))
+                if not self._is_valid_url(video_url, video_id):
+                    continue
                 http_format.update({
-                    'url': mp4_url.replace(mp4_url_basename, mobj.group(1)),
+                    'url': video_url,
                     'format_id': m3u8_format['format_id'].replace('hls', 'http'),
                     'protocol': 'http',
                 })