44 lines
1.4 KiB
Python
Raw Normal View History

2017-10-19 17:17:20 +02:00
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
2019-02-24 18:45:49 +01:00
import re
2017-10-19 17:17:20 +02:00
class ServusIE(InfoExtractor):
2019-02-16 14:43:50 +01:00
_VALID_URL = r'https?://(?:www\.)?servus\.com/tv/videos/(?P<id>aa-\w+|\d+-\d+)'
2019-02-24 16:37:24 +01:00
_TEST = {
2019-02-16 14:43:50 +01:00
'url': 'https://www.servus.com/tv/videos/aa-1t6vbu5pw1w12/',
2019-02-24 16:37:24 +01:00
'md5': '3e1dd16775aa8d5cbef23628cfffc1f4',
2017-10-19 17:17:20 +02:00
'info_dict': {
2019-02-24 16:37:24 +01:00
'id': 'AA-1T6VBU5PW1W12',
2017-10-19 17:17:20 +02:00
'ext': 'mp4',
2019-02-24 18:45:49 +01:00
'title': 'Die Grünen aus Sicht des Volkes',
2019-02-24 16:37:24 +01:00
'description': 'md5:1247204d85783afe3682644398ff2ec4',
'thumbnail': r're:^https?://.*1080$',
2017-10-19 17:17:20 +02:00
}
2019-02-24 16:37:24 +01:00
}
2017-10-19 17:17:20 +02:00
def _real_extract(self, url):
2019-02-16 15:02:01 +01:00
video_id = self._match_id(url).upper()
2017-10-19 17:17:20 +02:00
2019-02-16 14:43:50 +01:00
webpage = self._download_webpage(url, video_id)
2019-02-24 18:45:49 +01:00
title = re.search(r'videoLabel="(.*?)"', webpage).group(1)
2017-10-19 17:17:20 +02:00
description = self._og_search_description(webpage)
thumbnail = self._og_search_thumbnail(webpage)
formats = self._extract_m3u8_formats(
'https://stv.rbmbtnx.net/api/v1/manifests/%s.m3u8' % video_id,
video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
self._sort_formats(formats)
return {
'id': video_id,
'title': title,
'description': description,
'thumbnail': thumbnail,
'formats': formats,
}