]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/breakcom.py
34f555e891e1b6c1c079ef54ab976c53694b5daa
3 from .common
import InfoExtractor
6 class BreakIE(InfoExtractor
):
7 _VALID_URL
= r
'(?:http://)?(?:www\.)?break\.com/video/([^/]+)'
9 u
'url': u
'http://www.break.com/video/when-girls-act-like-guys-2468056',
10 u
'file': u
'2468056.mp4',
11 u
'md5': u
'a3513fb1547fba4fb6cfac1bffc6c46b',
13 u
"title": u
"When Girls Act Like D-Bags"
17 def _real_extract(self
, url
):
18 mobj
= re
.match(self
._VALID
_URL
, url
)
19 video_id
= mobj
.group(1).split("-")[-1]
20 webpage
= self
._download
_webpage
(url
, video_id
)
21 video_url
= re
.search(r
"videoPath: '(.+?)',",webpage
).group(1)
22 key
= re
.search(r
"icon: '(.+?)',",webpage
).group(1)
23 final_url
= str(video_url
)+"?"+str(key
)
24 thumbnail_url
= re
.search(r
"thumbnailURL: '(.+?)'",webpage
).group(1)
25 title
= re
.search(r
"sVidTitle: '(.+)',",webpage
).group(1)
26 ext
= video_url
.split('.')[-1]
32 'thumbnail': thumbnail_url
,