]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/teamcoco.py
3 from .common
import InfoExtractor
9 class TeamcocoIE(InfoExtractor
):
10 _VALID_URL
= r
'http://teamcoco\.com/video/(?P<url_title>.*)'
12 u
'url': u
'http://teamcoco.com/video/louis-ck-interview-george-w-bush',
13 u
'file': u
'19705.mp4',
14 u
'md5': u
'27b6f7527da5acf534b15f21b032656e',
16 u
"description": u
"Louis C.K. got starstruck by George W. Bush, so what? Part one.",
17 u
"title": u
"Louis C.K. Interview Pt. 1 11/3/11"
21 def _real_extract(self
, url
):
22 mobj
= re
.match(self
._VALID
_URL
, url
)
24 raise ExtractorError(u
'Invalid URL: %s' % url
)
25 url_title
= mobj
.group('url_title')
26 webpage
= self
._download
_webpage
(url
, url_title
)
28 video_id
= self
._html
_search
_regex
(r
'<article class="video" data-id="(\d+?)"',
31 self
.report_extraction(video_id
)
33 video_title
= self
._html
_search
_regex
(r
'<meta property="og:title" content="(.+?)"',
36 thumbnail
= self
._html
_search
_regex
(r
'<meta property="og:image" content="(.+?)"',
37 webpage
, u
'thumbnail', fatal
=False)
39 video_description
= self
._html
_search
_regex
(r
'<meta property="og:description" content="(.*?)"',
40 webpage
, u
'description', fatal
=False)
42 data_url
= 'http://teamcoco.com/cvp/2.0/%s.xml' % video_id
43 data
= self
._download
_webpage
(data_url
, video_id
, 'Downloading data webpage')
45 video_url
= self
._html
_search
_regex
(r
'<file type="high".*?>(.*?)</file>',
53 'thumbnail': thumbnail
,
54 'description': video_description
,