]>
Commit | Line | Data |
---|---|---|
f9b3d7af | 1 | # -*- coding: utf-8 -*- |
f3391db8 | 2 | from __future__ import unicode_literals |
f9b3d7af AE |
3 | |
4 | from .common import InfoExtractor | |
f9b3d7af | 5 | |
7cf67fbe | 6 | |
f9b3d7af | 7 | class SztvHuIE(InfoExtractor): |
f3391db8 | 8 | _VALID_URL = r'http://(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)' |
f9b3d7af | 9 | _TEST = { |
f3391db8 PH |
10 | 'url': 'http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornyezettudatos-eletmodot-a-savaria-teren-20130909', |
11 | 'md5': 'a6df607b11fb07d0e9f2ad94613375cb', | |
12 | 'info_dict': { | |
13 | 'id': '20130909', | |
14 | 'ext': 'mp4', | |
15 | 'title': 'Cserkészek népszerűsítették a környezettudatos életmódot a Savaria téren', | |
16 | 'description': 'A zöld nap játékos ismeretterjesztő programjait a Magyar Cserkész Szövetség szervezte, akik az ország nyolc városában adják át tudásukat az érdeklődőknek. A PET...', | |
9e4f50a8 | 17 | }, |
f9b3d7af AE |
18 | } |
19 | ||
20 | def _real_extract(self, url): | |
f3391db8 | 21 | video_id = self._match_id(url) |
7cf67fbe PH |
22 | webpage = self._download_webpage(url, video_id) |
23 | video_file = self._search_regex( | |
24 | r'file: "...:(.*?)",', webpage, 'video file') | |
25 | title = self._html_search_regex( | |
9d74e308 | 26 | r'<meta name="title" content="([^"]*?) - [^-]*? - [^-]*?"', |
7cf67fbe PH |
27 | webpage, 'video title') |
28 | description = self._html_search_regex( | |
29 | r'<meta name="description" content="([^"]*)"/>', | |
30 | webpage, 'video description', fatal=False) | |
f9b3d7af AE |
31 | thumbnail = self._og_search_thumbnail(webpage) |
32 | ||
7cf67fbe | 33 | video_url = 'http://media.sztv.hu/vod/' + video_file |
f9b3d7af | 34 | |
7cf67fbe PH |
35 | return { |
36 | 'id': video_id, | |
37 | 'url': video_url, | |
38 | 'title': title, | |
7cf67fbe PH |
39 | 'description': description, |
40 | 'thumbnail': thumbnail, | |
41 | } |