projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f11c316
)
Make FoxBusiness work.
author
nmrugg
<nmrugg@gmail.com>
Thu, 27 Aug 2015 15:24:13 +0000
(23:24 +0800)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 27 Aug 2015 15:41:08 +0000
(21:41 +0600)
youtube_dl/extractor/foxnews.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/foxnews.py
b/youtube_dl/extractor/foxnews.py
index 917f76b1effb3a2fff9d4f4c17c1cca348280132..7de88ab6614e15c6c5f44866a3d3e302cf7b19bd 100644
(file)
--- a/
youtube_dl/extractor/foxnews.py
+++ b/
youtube_dl/extractor/foxnews.py
@@
-1,5
+1,7
@@
from __future__ import unicode_literals
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
@@
-8,7
+10,7
@@
from ..utils import (
class FoxNewsIE(InfoExtractor):
class FoxNewsIE(InfoExtractor):
- _VALID_URL = r'https?://video\.fox
news
\.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',
_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)
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(
video = self._download_json(
- 'http://video.fox
news
.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']
item = video['channel']['item']
title = item['title']