]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/sztvhu.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / sztvhu.py
1 from .common import InfoExtractor
2
3
4 class SztvHuIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)'
6 _TEST = {
7 'url': 'http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornyezettudatos-eletmodot-a-savaria-teren-20130909',
8 'md5': 'a6df607b11fb07d0e9f2ad94613375cb',
9 'info_dict': {
10 'id': '20130909',
11 'ext': 'mp4',
12 'title': 'Cserkészek népszerűsítették a környezettudatos életmódot a Savaria téren',
13 '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...',
14 },
15 }
16
17 def _real_extract(self, url):
18 video_id = self._match_id(url)
19 webpage = self._download_webpage(url, video_id)
20 video_file = self._search_regex(
21 r'file: "...:(.*?)",', webpage, 'video file')
22 title = self._html_search_regex(
23 r'<meta name="title" content="([^"]*?) - [^-]*? - [^-]*?"',
24 webpage, 'video title')
25 description = self._html_search_regex(
26 r'<meta name="description" content="([^"]*)"/>',
27 webpage, 'video description', fatal=False)
28 thumbnail = self._og_search_thumbnail(webpage)
29
30 video_url = 'http://media.sztv.hu/vod/' + video_file
31
32 return {
33 'id': video_id,
34 'url': video_url,
35 'title': title,
36 'description': description,
37 'thumbnail': thumbnail,
38 }