about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-12-26 14:20:21 +0100
committerRemita Amine <remitamine@gmail.com>2017-12-26 14:20:21 +0100
commitdb145ee54a57f5ccc89639de8c589eb111a91b19 (patch)
treee0607d39f15836c6e20b3ae4f5724636bf9e38d4
parent45d20488f188b680daa39c5b9fa88d0bba102ab5 (diff)
downloadyoutube-dl-db145ee54a57f5ccc89639de8c589eb111a91b19.tar.gz
youtube-dl-db145ee54a57f5ccc89639de8c589eb111a91b19.tar.xz
youtube-dl-db145ee54a57f5ccc89639de8c589eb111a91b19.zip
[espn] Add new extractor for http://fivethirtyeight.com(closes #6864)
-rw-r--r--youtube_dl/extractor/espn.py31
-rw-r--r--youtube_dl/extractor/extractors.py1
2 files changed, 32 insertions, 0 deletions
diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py
index 0e135b8bc..127c69b2e 100644
--- a/youtube_dl/extractor/espn.py
+++ b/youtube_dl/extractor/espn.py
@@ -205,3 +205,34 @@ class ESPNArticleIE(InfoExtractor):
 
         return self.url_result(
             'http://espn.go.com/video/clip?id=%s' % video_id, ESPNIE.ie_key())
+
+
+class FiveThirtyEightIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?fivethirtyeight\.com/features/(?P<id>[^/?#]+)'
+    _TEST = {
+        'url': 'http://fivethirtyeight.com/features/how-the-6-8-raiders-can-still-make-the-playoffs/',
+        'info_dict': {
+            'id': '21846851',
+            'ext': 'mp4',
+            'title': 'FiveThirtyEight: The Raiders can still make the playoffs',
+            'description': 'Neil Paine breaks down the simplest scenario that will put the Raiders into the playoffs at 8-8.',
+            'timestamp': 1513960621,
+            'upload_date': '20171222',
+        },
+        'params': {
+            'skip_download': True,
+        },
+        'expected_warnings': ['Unable to download f4m manifest'],
+    }
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+
+        webpage = self._download_webpage(url, video_id)
+
+        video_id = self._search_regex(
+            r'data-video-id=["\'](?P<id>\d+)',
+            webpage, 'video id', group='id')
+
+        return self.url_result(
+            'http://espn.go.com/video/clip?id=%s' % video_id, ESPNIE.ie_key())
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index 3269ed743..91bd3287c 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -322,6 +322,7 @@ from .escapist import EscapistIE
 from .espn import (
     ESPNIE,
     ESPNArticleIE,
+    FiveThirtyEightIE,
 )
 from .esri import EsriVideoIE
 from .etonline import ETOnlineIE