]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/breakcom.py
   3 from .common 
import InfoExtractor
 
   6 class BreakIE(InfoExtractor
): 
   7     _VALID_URL 
= r
'(?:http://)?(?:www\.)?break\.com/video/([^/]+)' 
   9     def _real_extract(self
, url
): 
  10         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  11         video_id 
= mobj
.group(1).split("-")[-1] 
  12         webpage 
= self
._download
_webpage
(url
, video_id
) 
  13         video_url 
= re
.search(r
"videoPath: '(.+?)',",webpage
).group(1) 
  14         key 
= re
.search(r
"icon: '(.+?)',",webpage
).group(1) 
  15         final_url 
= str(video_url
)+"?"+str(key
) 
  16         thumbnail_url 
= re
.search(r
"thumbnailURL: '(.+?)'",webpage
).group(1) 
  17         title 
= re
.search(r
"sVidTitle: '(.+)',",webpage
).group(1) 
  18         ext 
= video_url
.split('.')[-1] 
  24             'thumbnail': thumbnail_url
,