]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/bet.py
1 from __future__
import unicode_literals
3 from .mtv
import MTVServicesInfoExtractor
4 from ..utils
import unified_strdate
6 # TODO Remove - Reason: Outdated Site
9 class BetIE(MTVServicesInfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html'
13 'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
15 'id': '07e96bd3-8850-3051-b856-271b457f0ab8',
16 'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
18 'title': 'A Conversation With President Obama',
19 'description': 'President Obama urges persistence in confronting racism and bias.',
21 'upload_date': '20141208',
22 'thumbnail': r
're:(?i)^https?://.*\.jpg$',
29 'skip_download': True,
33 'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
35 'id': '9f516bf1-7543-39c4-8076-dd441b459ba9',
36 'display_id': 'justice-for-ferguson-a-community-reacts',
38 'title': 'Justice for Ferguson: A Community Reacts',
39 'description': 'A BET News special.',
41 'upload_date': '20141125',
42 'thumbnail': r
're:(?i)^https?://.*\.jpg$',
49 'skip_download': True,
54 _FEED_URL
= "http://feeds.mtvnservices.com/od/feed/bet-mrss-player"
56 def _get_feed_query(self
, uri
):
61 def _extract_mgid(self
, webpage
):
62 return self
._search
_regex
(r
'data-uri="([^"]+)', webpage
, 'mgid')
64 def _real_extract(self
, url
):
65 display_id
= self
._match
_id
(url
)
67 webpage
= self
._download
_webpage
(url
, display_id
)
68 mgid
= self
._extract
_mgid
(webpage
)
69 videos_info
= self
._get
_videos
_info
(mgid
)
71 info_dict
= videos_info
['entries'][0]
73 upload_date
= unified_strdate(self
._html
_search
_meta
('date', webpage
))
74 description
= self
._html
_search
_meta
('description', webpage
)
77 'display_id': display_id
,
78 'description': description
,
79 'upload_date': upload_date
,