]>
Commit | Line | Data |
---|---|---|
c878e635 YCH |
1 | from .mtv import MTVServicesInfoExtractor |
2 | from ..utils import unified_strdate | |
b89a9386 S |
3 | |
4 | ||
c878e635 | 5 | class BetIE(MTVServicesInfoExtractor): |
9751a457 | 6 | _WORKING = False |
b89a9386 S |
7 | _VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html' |
8 | _TESTS = [ | |
9 | { | |
10 | 'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html', | |
11 | 'info_dict': { | |
c878e635 | 12 | 'id': '07e96bd3-8850-3051-b856-271b457f0ab8', |
b89a9386 S |
13 | 'display_id': 'in-bet-exclusive-obama-talks-race-and-racism', |
14 | 'ext': 'flv', | |
249962ff | 15 | 'title': 'A Conversation With President Obama', |
c878e635 | 16 | 'description': 'President Obama urges persistence in confronting racism and bias.', |
b89a9386 | 17 | 'duration': 1534, |
b89a9386 | 18 | 'upload_date': '20141208', |
ec85ded8 | 19 | 'thumbnail': r're:(?i)^https?://.*\.jpg$', |
c878e635 YCH |
20 | 'subtitles': { |
21 | 'en': 'mincount:2', | |
22 | } | |
b89a9386 S |
23 | }, |
24 | 'params': { | |
25 | # rtmp download | |
26 | 'skip_download': True, | |
27 | }, | |
28 | }, | |
29 | { | |
30 | 'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html', | |
31 | 'info_dict': { | |
c878e635 | 32 | 'id': '9f516bf1-7543-39c4-8076-dd441b459ba9', |
b89a9386 S |
33 | 'display_id': 'justice-for-ferguson-a-community-reacts', |
34 | 'ext': 'flv', | |
35 | 'title': 'Justice for Ferguson: A Community Reacts', | |
36 | 'description': 'A BET News special.', | |
37 | 'duration': 1696, | |
b89a9386 | 38 | 'upload_date': '20141125', |
ec85ded8 | 39 | 'thumbnail': r're:(?i)^https?://.*\.jpg$', |
c878e635 YCH |
40 | 'subtitles': { |
41 | 'en': 'mincount:2', | |
42 | } | |
b89a9386 S |
43 | }, |
44 | 'params': { | |
45 | # rtmp download | |
46 | 'skip_download': True, | |
47 | }, | |
48 | } | |
49 | ] | |
50 | ||
c878e635 | 51 | _FEED_URL = "http://feeds.mtvnservices.com/od/feed/bet-mrss-player" |
b89a9386 | 52 | |
c878e635 | 53 | def _get_feed_query(self, uri): |
0c75abbb | 54 | return { |
c878e635 | 55 | 'uuid': uri, |
0c75abbb | 56 | } |
249962ff | 57 | |
c878e635 YCH |
58 | def _extract_mgid(self, webpage): |
59 | return self._search_regex(r'data-uri="([^"]+)', webpage, 'mgid') | |
b89a9386 | 60 | |
c878e635 YCH |
61 | def _real_extract(self, url): |
62 | display_id = self._match_id(url) | |
b89a9386 | 63 | |
c878e635 YCH |
64 | webpage = self._download_webpage(url, display_id) |
65 | mgid = self._extract_mgid(webpage) | |
66 | videos_info = self._get_videos_info(mgid) | |
b89a9386 | 67 | |
c878e635 | 68 | info_dict = videos_info['entries'][0] |
b89a9386 | 69 | |
c878e635 YCH |
70 | upload_date = unified_strdate(self._html_search_meta('date', webpage)) |
71 | description = self._html_search_meta('description', webpage) | |
b89a9386 | 72 | |
c878e635 | 73 | info_dict.update({ |
b89a9386 | 74 | 'display_id': display_id, |
b89a9386 | 75 | 'description': description, |
c878e635 YCH |
76 | 'upload_date': upload_date, |
77 | }) | |
78 | ||
79 | return info_dict |