2016-06-18 06:17:24 +02:00
|
|
|
from .mtv import MTVServicesInfoExtractor
|
|
|
|
from ..utils import unified_strdate
|
2014-12-09 17:29:01 +01:00
|
|
|
|
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
class BetIE(MTVServicesInfoExtractor):
|
2023-11-26 04:09:59 +01:00
|
|
|
_WORKING = False
|
2014-12-09 17:29:01 +01:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html'
|
|
|
|
_TESTS = [
|
|
|
|
{
|
|
|
|
'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
|
|
|
|
'info_dict': {
|
2016-06-18 06:17:24 +02:00
|
|
|
'id': '07e96bd3-8850-3051-b856-271b457f0ab8',
|
2014-12-09 17:29:01 +01:00
|
|
|
'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
|
|
|
|
'ext': 'flv',
|
2015-05-07 17:56:15 +02:00
|
|
|
'title': 'A Conversation With President Obama',
|
2016-06-18 06:17:24 +02:00
|
|
|
'description': 'President Obama urges persistence in confronting racism and bias.',
|
2014-12-09 17:29:01 +01:00
|
|
|
'duration': 1534,
|
|
|
|
'upload_date': '20141208',
|
2017-01-02 13:08:07 +01:00
|
|
|
'thumbnail': r're:(?i)^https?://.*\.jpg$',
|
2016-06-18 06:17:24 +02:00
|
|
|
'subtitles': {
|
|
|
|
'en': 'mincount:2',
|
2024-06-12 01:09:58 +02:00
|
|
|
},
|
2014-12-09 17:29:01 +01:00
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
# rtmp download
|
|
|
|
'skip_download': True,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
|
|
|
|
'info_dict': {
|
2016-06-18 06:17:24 +02:00
|
|
|
'id': '9f516bf1-7543-39c4-8076-dd441b459ba9',
|
2014-12-09 17:29:01 +01:00
|
|
|
'display_id': 'justice-for-ferguson-a-community-reacts',
|
|
|
|
'ext': 'flv',
|
|
|
|
'title': 'Justice for Ferguson: A Community Reacts',
|
|
|
|
'description': 'A BET News special.',
|
|
|
|
'duration': 1696,
|
|
|
|
'upload_date': '20141125',
|
2017-01-02 13:08:07 +01:00
|
|
|
'thumbnail': r're:(?i)^https?://.*\.jpg$',
|
2016-06-18 06:17:24 +02:00
|
|
|
'subtitles': {
|
|
|
|
'en': 'mincount:2',
|
2024-06-12 01:09:58 +02:00
|
|
|
},
|
2014-12-09 17:29:01 +01:00
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
# rtmp download
|
|
|
|
'skip_download': True,
|
|
|
|
},
|
2024-06-12 01:09:58 +02:00
|
|
|
},
|
2014-12-09 17:29:01 +01:00
|
|
|
]
|
|
|
|
|
2024-06-12 01:09:58 +02:00
|
|
|
_FEED_URL = 'http://feeds.mtvnservices.com/od/feed/bet-mrss-player'
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
def _get_feed_query(self, uri):
|
2016-08-24 17:58:22 +02:00
|
|
|
return {
|
2016-06-18 06:17:24 +02:00
|
|
|
'uuid': uri,
|
2016-08-24 17:58:22 +02:00
|
|
|
}
|
2015-05-07 17:56:15 +02:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
def _extract_mgid(self, webpage):
|
|
|
|
return self._search_regex(r'data-uri="([^"]+)', webpage, 'mgid')
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
def _real_extract(self, url):
|
|
|
|
display_id = self._match_id(url)
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
webpage = self._download_webpage(url, display_id)
|
|
|
|
mgid = self._extract_mgid(webpage)
|
|
|
|
videos_info = self._get_videos_info(mgid)
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
info_dict = videos_info['entries'][0]
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
upload_date = unified_strdate(self._html_search_meta('date', webpage))
|
|
|
|
description = self._html_search_meta('description', webpage)
|
2014-12-09 17:29:01 +01:00
|
|
|
|
2016-06-18 06:17:24 +02:00
|
|
|
info_dict.update({
|
2014-12-09 17:29:01 +01:00
|
|
|
'display_id': display_id,
|
|
|
|
'description': description,
|
2016-06-18 06:17:24 +02:00
|
|
|
'upload_date': upload_date,
|
|
|
|
})
|
|
|
|
|
|
|
|
return info_dict
|