]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/screencastomatic.py
05337421ca4210af5a9a797f22c112bb663a0960
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_urlparse
12 class ScreencastOMaticIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://screencast-o-matic\.com/watch/(?P<id>[0-9a-zA-Z]+)'
15 'url': 'http://screencast-o-matic.com/watch/c2lD3BeOPl',
16 'md5': '483583cb80d92588f15ccbedd90f0c18',
20 'title': 'Welcome to 3-4 Philosophy @ DECV!',
21 'thumbnail': 're:^https?://.*\.jpg$',
22 'description': 'as the title says! also: some general info re 1) VCE philosophy and 2) distance learning.',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, video_id
)
30 setup_js
= self
._search
_regex
(
31 r
"(?s)jwplayer\('mp4Player'\).setup\((\{.*?\})\);",
32 webpage
, 'setup code')
33 data
= self
._parse
_json
(setup_js
, video_id
, transform_source
=js_to_json
)
36 m
for m
in data
['modes'] if m
.get('type') == 'html5')
38 raise ExtractorError('Could not find any video entries!')
39 video_url
= compat_urlparse
.urljoin(url
, video_data
['config']['file'])
40 thumbnail
= data
.get('image')
44 'title': self
._og
_search
_title
(webpage
),
45 'description': self
._og
_search
_description
(webpage
),
48 'thumbnail': thumbnail
,