aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/yahoo.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-03-31 02:47:18 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-03-31 02:47:18 +0800
commita2a4d5fa313d5244d24fa70d5db91971a7583d79 (patch)
tree463c5335f1b10b8f744ea5f4ff8315e3691ae5e7 /youtube_dl/extractor/yahoo.py
parenta28ccbabc60c81016c851ae46365be377ea83795 (diff)
downloadyoutube-dl-a2a4d5fa313d5244d24fa70d5db91971a7583d79.zip
youtube-dl-a2a4d5fa313d5244d24fa70d5db91971a7583d79.tar.gz
youtube-dl-a2a4d5fa313d5244d24fa70d5db91971a7583d79.tar.bz2
[Yahoo/NBCSports] Generalize NBC sports info extractor
Diffstat (limited to 'youtube_dl/extractor/yahoo.py')
-rw-r--r--youtube_dl/extractor/yahoo.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/extractor/yahoo.py b/youtube_dl/extractor/yahoo.py
index 6e72f1e..43776d1 100644
--- a/youtube_dl/extractor/yahoo.py
+++ b/youtube_dl/extractor/yahoo.py
@@ -17,6 +17,8 @@ from ..utils import (
int_or_none,
)
+from .nbc import NBCSportsVPlayerIE
+
class YahooIE(InfoExtractor):
IE_DESC = 'Yahoo screen and movies'
@@ -132,6 +134,7 @@ class YahooIE(InfoExtractor):
}, {
'note': 'NBC Sports embeds',
'url': 'http://sports.yahoo.com/blogs/ncaab-the-dagger/tyler-kalinoski-s-buzzer-beater-caps-davidson-s-comeback-win-185609842.html?guid=nbc_cbk_davidsonbuzzerbeater_150313',
+ 'md5': 'ceae8dced5c14a1c1ffcb7a32194cca5',
'info_dict': {
'id': '9CsDKds0kvHI',
'ext': 'flv',
@@ -161,10 +164,9 @@ class YahooIE(InfoExtractor):
video_id = items[0]['id']
return self._get_info(video_id, display_id, webpage)
# Look for NBCSports iframes
- iframe_m = re.search(
- r'<iframe[^>]+src="(?P<url>https?://vplayer\.nbcsports\.com/[^"]+)"', webpage)
- if iframe_m:
- return self.url_result(iframe_m.group('url'), 'NBCSports')
+ nbc_sports_url = NBCSportsVPlayerIE._extract_url(webpage)
+ if nbc_sports_url:
+ return self.url_result(nbc_sports_url, 'NBCSportsVPlayer')
items_json = self._search_regex(
r'mediaItems: ({.*?})$', webpage, 'items', flags=re.MULTILINE,