diff options
author | Unknown <blackjack4494@web.de> | 2020-09-02 23:33:41 +0200 |
---|---|---|
committer | Unknown <blackjack4494@web.de> | 2020-09-02 23:33:41 +0200 |
commit | 3ca3f77f9ce9dd504dc6af4ef605c245c31ff860 (patch) | |
tree | 6bd9c9352327148a78b8c46227c8d526f1447b03 /youtube_dl/extractor/helsinki.py | |
parent | 4cd6add62b54721eeb3bf76bd9c0b4d676dc4d68 (diff) | |
download | hypervideo-pre-3ca3f77f9ce9dd504dc6af4ef605c245c31ff860.tar.lz hypervideo-pre-3ca3f77f9ce9dd504dc6af4ef605c245c31ff860.tar.xz hypervideo-pre-3ca3f77f9ce9dd504dc6af4ef605c245c31ff860.zip |
[skip travis] adding automerge support
basically copying content of youtube_dl folder to youtube_dlc and excluding the youtube_dl folder when compiling
Diffstat (limited to 'youtube_dl/extractor/helsinki.py')
-rw-r--r-- | youtube_dl/extractor/helsinki.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/youtube_dl/extractor/helsinki.py b/youtube_dl/extractor/helsinki.py new file mode 100644 index 000000000..575fb332a --- /dev/null +++ b/youtube_dl/extractor/helsinki.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import js_to_json + + +class HelsinkiIE(InfoExtractor): + IE_DESC = 'helsinki.fi' + _VALID_URL = r'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)' + _TEST = { + 'url': 'http://video.helsinki.fi/Arkisto/flash.php?id=20258', + 'info_dict': { + 'id': '20258', + 'ext': 'mp4', + 'title': 'Tietotekniikkafoorumi-iltapäivä', + 'description': 'md5:f5c904224d43c133225130fe156a5ee0', + }, + 'params': { + 'skip_download': True, # RTMP + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + params = self._parse_json(self._html_search_regex( + r'(?s)jwplayer\("player"\).setup\((\{.*?\})\);', + webpage, 'player code'), video_id, transform_source=js_to_json) + formats = [{ + 'url': s['file'], + 'ext': 'mp4', + } for s in params['sources']] + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': self._og_search_title(webpage).replace('Video: ', ''), + 'description': self._og_search_description(webpage), + 'formats': formats, + } |