diff options
author | nmrugg <nmrugg@gmail.com> | 2015-08-27 23:24:13 +0800 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-08-27 21:41:08 +0600 |
commit | d7e8264517d29156697f82b7761dc99d13994c21 (patch) | |
tree | d5e9c2fd57ec6d44a595b9e7c08ad756d082aaf7 /youtube_dl/extractor | |
parent | f11c316347bea41d9148d1c8d5d7738a594a06d0 (diff) |
Make FoxBusiness work.
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/foxnews.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/foxnews.py b/youtube_dl/extractor/foxnews.py index 917f76b1e..7de88ab66 100644 --- a/youtube_dl/extractor/foxnews.py +++ b/youtube_dl/extractor/foxnews.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals +import re + from .common import InfoExtractor from ..utils import ( parse_iso8601, @@ -8,7 +10,7 @@ from ..utils import ( class FoxNewsIE(InfoExtractor): - _VALID_URL = r'https?://video\.foxnews\.com/v/(?:video-embed\.html\?video_id=)?(?P<id>\d+)' + _VALID_URL = r'https?://video\.fox(?:news|business)\.com/v/(?:video-embed\.html\?video_id=)?(?P<id>\d+)' _TESTS = [ { 'url': 'http://video.foxnews.com/v/3937480/frozen-in-time/#sp=show-clips', @@ -47,8 +49,10 @@ class FoxNewsIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) + m = re.match(r'^https?://video\.fox(news|business)', url) + video = self._download_json( - 'http://video.foxnews.com/v/feed/video/%s.js?template=fox' % video_id, video_id) + 'http://video.fox' + m.group(1) + '.com/v/feed/video/%s.js?template=fox' % video_id, video_id) item = video['channel']['item'] title = item['title'] |