]>
Commit | Line | Data |
---|---|---|
3f0852e3 RSK |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | from .common import InfoExtractor | |
5 | from ..utils import ( | |
6 | int_or_none, | |
3f0852e3 RSK |
7 | ) |
8 | ||
9 | ||
10 | class ZoomUSIE(InfoExtractor): | |
11 | IE_NAME = 'zoom.us' | |
ef6be420 | 12 | _VALID_URL = r'https://(.*).?zoom.us/rec(ording)?/play/(?P<id>.*)' |
3f0852e3 | 13 | |
55cd2999 | 14 | _TEST = { |
3f0852e3 RSK |
15 | 'url': 'https://zoom.us/recording/play/SILVuCL4bFtRwWTtOCFQQxAsBQsJljFtm9e4Z_bvo-A8B-nzUSYZRNuPl3qW5IGK', |
16 | 'info_dict': { | |
55cd2999 RSK |
17 | 'md5': '031a5b379f1547a8b29c5c4c837dccf2', |
18 | 'title': "GAZ Transformational Tuesdays W/ Landon & Stapes", | |
19 | 'id': "SILVuCL4bFtRwWTtOCFQQxAsBQsJljFtm9e4Z_bvo-A8B-nzUSYZRNuPl3qW5IGK", | |
20 | 'ext': "mp4", | |
3f0852e3 | 21 | } |
55cd2999 | 22 | } |
3f0852e3 RSK |
23 | |
24 | def _real_extract(self, url): | |
25 | display_id = self._match_id(url) | |
26 | webpage = self._download_webpage(url, display_id) | |
3f0852e3 RSK |
27 | |
28 | video_url = self._search_regex(r"viewMp4Url: \'(.*)\'", webpage, 'video url') | |
29 | topic = self._search_regex(r"topic: \"(.*)\",", webpage, 'video url') | |
30 | viewResolvtionsWidth = self._search_regex(r"viewResolvtionsWidth: (.*),", webpage, 'res width') | |
31 | viewResolvtionsHeight = self._search_regex(r"viewResolvtionsHeight: (.*),", webpage, 'res width') | |
32 | ||
33 | formats = [] | |
34 | formats.append({ | |
35 | 'url': video_url, | |
36 | 'width': int_or_none(viewResolvtionsWidth), | |
37 | 'height': int_or_none(viewResolvtionsHeight), | |
55cd2999 RSK |
38 | 'http_headers': {'Accept': 'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5', |
39 | 'Referer': 'https://zoom.us/'} | |
3f0852e3 RSK |
40 | }) |
41 | self._sort_formats(formats) | |
42 | ||
43 | return { | |
44 | 'id': display_id, | |
45 | 'title': topic, | |
46 | 'formats': formats | |
55cd2999 | 47 | } |