]>
Commit | Line | Data |
---|---|---|
6e1b9395 PH |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
a4a554a7 | 4 | from .common import InfoExtractor |
66fa4958 | 5 | from ..utils import js_to_json |
6e1b9395 PH |
6 | |
7 | ||
a4a554a7 | 8 | class ScreencastOMaticIE(InfoExtractor): |
6e1b9395 PH |
9 | _VALID_URL = r'https?://screencast-o-matic\.com/watch/(?P<id>[0-9a-zA-Z]+)' |
10 | _TEST = { | |
11 | 'url': 'http://screencast-o-matic.com/watch/c2lD3BeOPl', | |
12 | 'md5': '483583cb80d92588f15ccbedd90f0c18', | |
13 | 'info_dict': { | |
14 | 'id': 'c2lD3BeOPl', | |
15 | 'ext': 'mp4', | |
16 | 'title': 'Welcome to 3-4 Philosophy @ DECV!', | |
ec85ded8 | 17 | 'thumbnail': r're:^https?://.*\.jpg$', |
6e1b9395 | 18 | 'description': 'as the title says! also: some general info re 1) VCE philosophy and 2) distance learning.', |
d7eb052f | 19 | 'duration': 369.163, |
6e1b9395 PH |
20 | } |
21 | } | |
22 | ||
23 | def _real_extract(self, url): | |
24 | video_id = self._match_id(url) | |
25 | webpage = self._download_webpage(url, video_id) | |
26 | ||
66fa4958 S |
27 | jwplayer_data = self._parse_json( |
28 | self._search_regex( | |
29 | r"(?s)jwplayer\('mp4Player'\).setup\((\{.*?\})\);", webpage, 'setup code'), | |
30 | video_id, transform_source=js_to_json) | |
6e1b9395 | 31 | |
66fa4958 S |
32 | info_dict = self._parse_jwplayer_data(jwplayer_data, video_id, require_title=False) |
33 | info_dict.update({ | |
6e1b9395 PH |
34 | 'title': self._og_search_title(webpage), |
35 | 'description': self._og_search_description(webpage), | |
66fa4958 S |
36 | }) |
37 | return info_dict |