X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fnfl.py;h=2684dd250aa65e22903612f4a1780fc8f701296a;hb=de765f6c3188802bb2dea704a645f539fa61c8aa;hp=cc7c921c364d64ee504fa6d31265d13a96565e8d;hpb=f889cea109b4e2647e3fd6a462c9893b88b21e04;p=youtube-dl diff --git a/youtube_dl/extractor/nfl.py b/youtube_dl/extractor/nfl.py index cc7c921c3..2684dd250 100644 --- a/youtube_dl/extractor/nfl.py +++ b/youtube_dl/extractor/nfl.py @@ -4,9 +4,11 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..compat import ( + compat_urllib_parse_urlparse, +) from ..utils import ( ExtractorError, - compat_urllib_parse_urlparse, int_or_none, remove_end, ) @@ -44,7 +46,18 @@ class NFLIE(InfoExtractor): 'timestamp': 1388354455, 'thumbnail': 're:^https?://.*\.jpg$', } - } + }, + { + 'url': 'http://www.nfl.com/news/story/0ap3000000467586/article/patriots-seahawks-involved-in-lategame-skirmish', + 'info_dict': { + 'id': '0ap3000000467607', + 'ext': 'mp4', + 'title': 'Frustrations flare on the field', + 'description': 'Emotions ran high at the end of the Super Bowl on both sides of the ball after a dramatic finish.', + 'timestamp': 1422850320, + 'upload_date': '20150202', + }, + }, ] @staticmethod @@ -78,7 +91,11 @@ class NFLIE(InfoExtractor): webpage = self._download_webpage(url, video_id) config_url = NFLIE.prepend_host(host, self._search_regex( - r'(?:config|configURL)\s*:\s*"([^"]+)"', webpage, 'config URL')) + r'(?:config|configURL)\s*:\s*"([^"]+)"', webpage, 'config URL', + default='static/content/static/config/video/config.json')) + # For articles, the id in the url is not the video id + video_id = self._search_regex( + r'contentId\s*:\s*"([^"]+)"', webpage, 'video id', default=video_id) config = self._download_json(config_url, video_id, note='Downloading player config') url_template = NFLIE.prepend_host(