]>
Raphaƫl G. Git Repositories - youtubedl/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 def _real_extract(self
, url
):
13 mobj
= re
.match(self
._VALID
_URL
, url
)
15 raise ExtractorError(u
'Invalid URL: %s' % url
)
16 url_title
= mobj
.group('url_title')
17 webpage
= self
._download
_webpage
(url
, url_title
)
19 video_id
= self
._html
_search
_regex
(r
'<article class="video" data-id="(\d+?)"',
22 self
.report_extraction(video_id
)
24 video_title
= self
._html
_search
_regex
(r
'<meta property="og:title" content="(.+?)"',
27 thumbnail
= self
._html
_search
_regex
(r
'<meta property="og:image" content="(.+?)"',
28 webpage
, u
'thumbnail', fatal
=False)
30 video_description
= self
._html
_search
_regex
(r
'<meta property="og:description" content="(.*?)"',
31 webpage
, u
'description', fatal
=False)
33 data_url
= 'http://teamcoco.com/cvp/2.0/%s.xml' % video_id
34 data
= self
._download
_webpage
(data_url
, video_id
, 'Downloading data webpage')
36 video_url
= self
._html
_search
_regex
(r
'<file type="high".*?>(.*?)</file>',
44 'thumbnail': thumbnail
,
45 'description': video_description
,