1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class RingTVIE(InfoExtractor):
9 _VALID_URL = r'(?:http://)?(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)'
11 "url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-victor-ortiz-better-not-quit-on-jan-30",
13 "md5": "d25945f5df41cdca2d2587165ac28720",
15 "title": 'Video: Luis Collazo says Victor Ortiz "better not quit on Jan. 30" - Ring TV',
16 "description": 'Luis Collazo is excited about his Jan. 30 showdown with fellow former welterweight titleholder Victor Ortiz at Barclays Center in his hometown of Brooklyn. The SuperBowl week fight headlines a Golden Boy Live! card on Fox Sports 1.',
20 def _real_extract(self, url):
21 mobj = re.match(self._VALID_URL, url)
22 video_id = mobj.group('id').split('-')[0]
23 webpage = self._download_webpage(url, video_id)
25 if mobj.group('type') == 'news':
26 video_id = self._search_regex(
27 r'''(?x)<iframe[^>]+src="http://cms\.springboardplatform\.com/
28 embed_iframe/[0-9]+/video/([0-9]+)/''',
29 webpage, 'real video ID')
30 title = self._og_search_title(webpage)
31 description = self._html_search_regex(
32 r'addthis:description="([^"]+)"',
33 webpage, 'description', fatal=False)
34 final_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/conversion/%s.mp4" % video_id
35 thumbnail_url = "http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/snapshots/%s.jpg" % video_id
41 'thumbnail': thumbnail_url,
42 'description': description,