]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ringtv.py
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' ,
12 'md5' : 'd25945f5df41cdca2d2587165ac28720' ,
16 'title' : 'Video: Luis Collazo says Victor Ortiz "better not quit on Jan. 30" - Ring TV' ,
17 '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.' ,
21 def _real_extract ( self
, url
):
22 mobj
= re
. match ( self
._ VALID
_U RL
, url
)
23 video_id
= mobj
. group ( 'id' ). split ( '-' )[ 0 ]
24 webpage
= self
._ download
_ webpage
( url
, video_id
)
26 if mobj
. group ( 'type' ) == 'news' :
27 video_id
= self
._ search
_ regex
(
28 r
'''(?x)<iframe[^>]+src="http://cms\.springboardplatform\.com/
29 embed_iframe/[0-9]+/video/([0-9]+)/''' ,
30 webpage
, 'real video ID' )
31 title
= self
._ og
_ search
_ title
( webpage
)
32 description
= self
._ html
_ search
_ regex
(
33 r
'addthis:description="([^"]+)"' ,
34 webpage
, 'description' , fatal
= False )
35 final_url
= 'http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/conversion/ %s .mp4' % video_id
36 thumbnail_url
= 'http://ringtv.craveonline.springboardplatform.com/storage/ringtv.craveonline.com/snapshots/ %s .jpg' % video_id
42 'thumbnail' : thumbnail_url
,
43 'description' : description
,