2018-09-01 17:43:34 +00:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2020-06-05 18:35:09 +00:00
|
|
|
from ..compat import compat_urlparse
|
2020-06-05 18:45:05 +00:00
|
|
|
from ..utils import (
|
2022-01-17 13:11:11 +00:00
|
|
|
ExtractorError,
|
|
|
|
extract_attributes,
|
2020-06-05 18:45:05 +00:00
|
|
|
)
|
2018-09-01 17:43:34 +00:00
|
|
|
|
2022-01-17 13:11:11 +00:00
|
|
|
from .dplay import DPlayIE
|
|
|
|
|
2018-09-01 17:43:34 +00:00
|
|
|
|
2022-01-17 13:11:11 +00:00
|
|
|
class Tele5IE(DPlayIE):
|
2019-05-12 17:11:48 +00:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?tele5\.de/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
2020-06-05 18:45:05 +00:00
|
|
|
_GEO_COUNTRIES = ['DE']
|
2018-09-01 17:43:34 +00:00
|
|
|
_TESTS = [{
|
2018-09-08 09:04:39 +00:00
|
|
|
'url': 'https://www.tele5.de/mediathek/filme-online/videos?vid=1549416',
|
2018-09-01 17:43:34 +00:00
|
|
|
'info_dict': {
|
2018-09-08 09:04:39 +00:00
|
|
|
'id': '1549416',
|
2018-09-01 17:43:34 +00:00
|
|
|
'ext': 'mp4',
|
2018-09-08 09:04:39 +00:00
|
|
|
'upload_date': '20180814',
|
|
|
|
'timestamp': 1534290623,
|
|
|
|
'title': 'Pandorum',
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'skip_download': True,
|
|
|
|
},
|
2022-01-17 13:11:11 +00:00
|
|
|
'skip': 'No longer available: "404 Seite nicht gefunden"',
|
2020-06-05 18:35:09 +00:00
|
|
|
}, {
|
|
|
|
# jwplatform, nexx unavailable
|
|
|
|
'url': 'https://www.tele5.de/filme/ghoul-das-geheimnis-des-friedhofmonsters/',
|
|
|
|
'info_dict': {
|
|
|
|
'id': 'WJuiOlUp',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'upload_date': '20200603',
|
|
|
|
'timestamp': 1591214400,
|
|
|
|
'title': 'Ghoul - Das Geheimnis des Friedhofmonsters',
|
|
|
|
'description': 'md5:42002af1d887ff3d5b2b3ca1f8137d97',
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'skip_download': True,
|
|
|
|
},
|
2022-01-17 13:11:11 +00:00
|
|
|
'skip': 'No longer available, redirects to Filme page',
|
|
|
|
}, {
|
|
|
|
'url': 'https://tele5.de/mediathek/angel-of-mine/',
|
|
|
|
'info_dict': {
|
|
|
|
'id': '1252360',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'upload_date': '20220109',
|
|
|
|
'timestamp': 1641762000,
|
|
|
|
'title': 'Angel of Mine',
|
|
|
|
'description': 'md5:a72546a175e1286eb3251843a52d1ad7',
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'format': 'bestvideo',
|
|
|
|
},
|
2018-09-08 09:04:39 +00:00
|
|
|
}, {
|
2019-05-12 17:11:48 +00:00
|
|
|
'url': 'https://www.tele5.de/kalkofes-mattscheibe/video-clips/politik-und-gesellschaft?ve_id=1551191',
|
2018-09-08 09:04:39 +00:00
|
|
|
'only_matching': True,
|
2018-09-01 17:43:34 +00:00
|
|
|
}, {
|
2019-05-12 17:11:48 +00:00
|
|
|
'url': 'https://www.tele5.de/video-clip/?ve_id=1609440',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://www.tele5.de/filme/schlefaz-dragon-crusaders/',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://www.tele5.de/filme/making-of/avengers-endgame/',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://www.tele5.de/star-trek/raumschiff-voyager/ganze-folge/das-vinculum/',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://www.tele5.de/anders-ist-sevda/',
|
2018-09-01 17:43:34 +00:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2022-01-17 13:11:11 +00:00
|
|
|
video_id = self._match_id(url)
|
|
|
|
webpage = self._download_webpage(url, video_id)
|
|
|
|
player_element = self._search_regex(r'(<hyoga-player\b[^>]+?>)', webpage, 'video player')
|
|
|
|
player_info = extract_attributes(player_element)
|
|
|
|
asset_id, country, realm = (player_info[x] for x in ('assetid', 'locale', 'realm', ))
|
|
|
|
endpoint = compat_urlparse.urlparse(player_info['endpoint']).hostname
|
|
|
|
source_type = player_info.get('sourcetype')
|
|
|
|
if source_type:
|
|
|
|
endpoint = '%s-%s' % (source_type, endpoint)
|
|
|
|
try:
|
|
|
|
return self._get_disco_api_info(url, asset_id, endpoint, realm, country)
|
|
|
|
except ExtractorError as e:
|
|
|
|
if getattr(e, 'message', '') == 'Missing deviceId in context':
|
|
|
|
raise ExtractorError('DRM protected', cause=e, expected=True)
|
|
|
|
raise
|