aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-08-27 21:48:03 +0600
committerSergey M․ <dstftw@gmail.com>2015-08-27 21:48:03 +0600
commit1b660cce120c733f2bb195ef1cfe2ff2421b439f (patch)
treeb308a35a7c04ef04044a892acc38cadaf0c1afc6
parent8df8c278b6d5e2b5a350446690873dc9f5f48aff (diff)
[foxnews] Simplify (Closes #6694)
-rw-r--r--youtube_dl/extractor/foxnews.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube_dl/extractor/foxnews.py b/youtube_dl/extractor/foxnews.py
index a8902c960..244c75f0b 100644
--- a/youtube_dl/extractor/foxnews.py
+++ b/youtube_dl/extractor/foxnews.py
@@ -10,7 +10,7 @@ from ..utils import (
class FoxNewsIE(InfoExtractor):
- _VALID_URL = r'https?://video\.fox(?:news|business)\.com/v/(?:video-embed\.html\?video_id=)?(?P<id>\d+)'
+ _VALID_URL = r'https?://(?P<host>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',
@@ -51,12 +51,12 @@ class FoxNewsIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
-
- m = re.match(r'^https?://video\.fox(news|business)', url)
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group('id')
+ host = mobj.group('host')
video = self._download_json(
- 'http://video.fox' + m.group(1) + '.com/v/feed/video/%s.js?template=fox' % video_id, video_id)
+ 'http://%s/v/feed/video/%s.js?template=fox' % (host, video_id), video_id)
item = video['channel']['item']
title = item['title']