2017-11-05 10:07:35 -07:00
|
|
|
import re
|
2018-04-30 12:48:21 -06:00
|
|
|
from uuid import uuid4
|
2017-11-05 10:07:35 -07:00
|
|
|
|
|
|
|
from .common import InfoExtractor
|
2023-07-09 01:53:02 -06:00
|
|
|
from ..compat import compat_str
|
|
|
|
from ..networking.exceptions import HTTPError
|
2018-04-30 12:48:21 -06:00
|
|
|
from ..utils import (
|
2017-11-05 10:07:35 -07:00
|
|
|
ExtractorError,
|
2018-04-30 12:48:21 -06:00
|
|
|
int_or_none,
|
2021-11-05 19:05:24 -06:00
|
|
|
join_nonempty,
|
2018-04-30 12:48:21 -06:00
|
|
|
try_get,
|
2018-07-21 06:08:28 -06:00
|
|
|
url_or_none,
|
2017-11-05 10:07:35 -07:00
|
|
|
urlencode_postdata,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2018-09-23 10:30:18 -06:00
|
|
|
class ZattooPlatformBaseIE(InfoExtractor):
|
2017-11-05 10:07:35 -07:00
|
|
|
_power_guide_hash = None
|
|
|
|
|
2018-09-23 10:30:18 -06:00
|
|
|
def _host_url(self):
|
2018-11-05 01:52:46 -07:00
|
|
|
return 'https://%s' % (self._API_HOST if hasattr(self, '_API_HOST') else self._HOST)
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-03-18 14:53:33 -06:00
|
|
|
def _real_initialize(self):
|
|
|
|
if not self._power_guide_hash:
|
|
|
|
self.raise_login_required('An account is needed to access this media', method='password')
|
2018-04-30 12:48:21 -06:00
|
|
|
|
2022-03-18 14:53:33 -06:00
|
|
|
def _perform_login(self, username, password):
|
2018-04-30 12:48:21 -06:00
|
|
|
try:
|
|
|
|
data = self._download_json(
|
2018-09-23 10:30:18 -06:00
|
|
|
'%s/zapi/v2/account/login' % self._host_url(), None, 'Logging in',
|
2018-04-30 12:48:21 -06:00
|
|
|
data=urlencode_postdata({
|
|
|
|
'login': username,
|
|
|
|
'password': password,
|
|
|
|
'remember': 'true',
|
|
|
|
}), headers={
|
2018-09-23 10:30:18 -06:00
|
|
|
'Referer': '%s/login' % self._host_url(),
|
2018-04-30 12:48:21 -06:00
|
|
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
|
|
})
|
|
|
|
except ExtractorError as e:
|
2023-07-09 01:53:02 -06:00
|
|
|
if isinstance(e.cause, HTTPError) and e.cause.status == 400:
|
2018-04-30 12:48:21 -06:00
|
|
|
raise ExtractorError(
|
|
|
|
'Unable to login: incorrect username and/or password',
|
|
|
|
expected=True)
|
|
|
|
raise
|
|
|
|
|
|
|
|
self._power_guide_hash = data['session']['power_guide_hash']
|
|
|
|
|
2022-03-18 14:53:33 -06:00
|
|
|
def _initialize_pre_login(self):
|
2022-04-08 00:44:58 -06:00
|
|
|
session_token = self._download_json(
|
|
|
|
f'{self._host_url()}/token.json', None, 'Downloading session token')['session_token']
|
2018-04-30 12:48:21 -06:00
|
|
|
|
|
|
|
# Will setup appropriate cookies
|
|
|
|
self._request_webpage(
|
2022-04-08 00:44:58 -06:00
|
|
|
'%s/zapi/v3/session/hello' % self._host_url(), None,
|
2018-04-30 12:48:21 -06:00
|
|
|
'Opening session', data=urlencode_postdata({
|
|
|
|
'uuid': compat_str(uuid4()),
|
|
|
|
'lang': 'en',
|
2022-04-08 00:44:58 -06:00
|
|
|
'app_version': '1.8.2',
|
2018-04-30 12:48:21 -06:00
|
|
|
'format': 'json',
|
2022-04-08 00:44:58 -06:00
|
|
|
'client_app_token': session_token,
|
2018-04-30 12:48:21 -06:00
|
|
|
}))
|
2017-11-05 10:07:35 -07:00
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_video_id_from_recording(self, recid):
|
|
|
|
playlist = self._download_json(
|
|
|
|
f'{self._host_url()}/zapi/v2/playlist', recid, 'Downloading playlist')
|
|
|
|
try:
|
|
|
|
return next(
|
|
|
|
str(item['program_id']) for item in playlist['recordings']
|
|
|
|
if item.get('program_id') and str(item.get('id')) == recid)
|
|
|
|
except (StopIteration, KeyError):
|
|
|
|
raise ExtractorError('Could not extract video id from recording')
|
|
|
|
|
2017-11-05 10:07:35 -07:00
|
|
|
def _extract_cid(self, video_id, channel_name):
|
|
|
|
channel_groups = self._download_json(
|
2018-09-23 10:30:18 -06:00
|
|
|
'%s/zapi/v2/cached/channels/%s' % (self._host_url(),
|
2017-11-05 10:07:35 -07:00
|
|
|
self._power_guide_hash),
|
2018-04-30 12:48:21 -06:00
|
|
|
video_id, 'Downloading channel list',
|
2017-11-05 10:07:35 -07:00
|
|
|
query={'details': False})['channel_groups']
|
|
|
|
channel_list = []
|
|
|
|
for chgrp in channel_groups:
|
|
|
|
channel_list.extend(chgrp['channels'])
|
|
|
|
try:
|
|
|
|
return next(
|
|
|
|
chan['cid'] for chan in channel_list
|
2018-04-30 12:48:21 -06:00
|
|
|
if chan.get('cid') and (
|
2019-05-10 14:56:22 -06:00
|
|
|
chan.get('display_alias') == channel_name
|
|
|
|
or chan.get('cid') == channel_name))
|
2017-11-05 10:07:35 -07:00
|
|
|
except StopIteration:
|
|
|
|
raise ExtractorError('Could not extract channel id')
|
|
|
|
|
|
|
|
def _extract_cid_and_video_info(self, video_id):
|
|
|
|
data = self._download_json(
|
2018-09-23 08:34:47 -06:00
|
|
|
'%s/zapi/v2/cached/program/power_details/%s' % (
|
2018-09-23 10:30:18 -06:00
|
|
|
self._host_url(), self._power_guide_hash),
|
2017-11-05 10:07:35 -07:00
|
|
|
video_id,
|
|
|
|
'Downloading video information',
|
|
|
|
query={
|
2018-09-23 08:34:47 -06:00
|
|
|
'program_ids': video_id,
|
|
|
|
'complete': True,
|
2017-11-05 10:07:35 -07:00
|
|
|
})
|
|
|
|
|
2018-09-23 08:34:47 -06:00
|
|
|
p = data['programs'][0]
|
2018-04-30 12:48:21 -06:00
|
|
|
cid = p['cid']
|
|
|
|
|
2017-11-05 10:07:35 -07:00
|
|
|
info_dict = {
|
|
|
|
'id': video_id,
|
2018-09-23 08:34:47 -06:00
|
|
|
'title': p.get('t') or p['et'],
|
|
|
|
'description': p.get('d'),
|
|
|
|
'thumbnail': p.get('i_url'),
|
2018-04-30 12:48:21 -06:00
|
|
|
'creator': p.get('channel_name'),
|
2018-09-23 08:34:47 -06:00
|
|
|
'episode': p.get('et'),
|
|
|
|
'episode_number': int_or_none(p.get('e_no')),
|
|
|
|
'season_number': int_or_none(p.get('s_no')),
|
2018-04-30 12:48:21 -06:00
|
|
|
'release_year': int_or_none(p.get('year')),
|
2018-09-23 08:34:47 -06:00
|
|
|
'categories': try_get(p, lambda x: x['c'], list),
|
|
|
|
'tags': try_get(p, lambda x: x['g'], list)
|
2017-11-05 10:07:35 -07:00
|
|
|
}
|
2018-04-30 12:48:21 -06:00
|
|
|
|
2017-11-05 10:07:35 -07:00
|
|
|
return cid, info_dict
|
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_ondemand_info(self, ondemand_id):
|
|
|
|
"""
|
|
|
|
@returns (ondemand_token, ondemand_type, info_dict)
|
|
|
|
"""
|
|
|
|
data = self._download_json(
|
|
|
|
'%s/zapi/vod/movies/%s' % (self._host_url(), ondemand_id),
|
|
|
|
ondemand_id, 'Downloading ondemand information')
|
|
|
|
info_dict = {
|
|
|
|
'id': ondemand_id,
|
|
|
|
'title': data.get('title'),
|
|
|
|
'description': data.get('description'),
|
|
|
|
'duration': int_or_none(data.get('duration')),
|
|
|
|
'release_year': int_or_none(data.get('year')),
|
|
|
|
'episode_number': int_or_none(data.get('episode_number')),
|
|
|
|
'season_number': int_or_none(data.get('season_number')),
|
|
|
|
'categories': try_get(data, lambda x: x['categories'], list),
|
|
|
|
}
|
|
|
|
return data['terms_catalog'][0]['terms'][0]['token'], data['type'], info_dict
|
|
|
|
|
|
|
|
def _extract_formats(self, cid, video_id, record_id=None, ondemand_id=None, ondemand_termtoken=None, ondemand_type=None, is_live=False):
|
2018-04-30 12:48:21 -06:00
|
|
|
postdata_common = {
|
2017-11-05 10:07:35 -07:00
|
|
|
'https_watch_urls': True,
|
|
|
|
}
|
|
|
|
|
|
|
|
if is_live:
|
2018-04-30 12:48:21 -06:00
|
|
|
postdata_common.update({'timeshift': 10800})
|
2018-09-23 10:30:18 -06:00
|
|
|
url = '%s/zapi/watch/live/%s' % (self._host_url(), cid)
|
2018-04-30 12:48:21 -06:00
|
|
|
elif record_id:
|
2018-09-23 10:30:18 -06:00
|
|
|
url = '%s/zapi/watch/recording/%s' % (self._host_url(), record_id)
|
2022-04-08 00:44:58 -06:00
|
|
|
elif ondemand_id:
|
|
|
|
postdata_common.update({
|
|
|
|
'teasable_id': ondemand_id,
|
|
|
|
'term_token': ondemand_termtoken,
|
|
|
|
'teasable_type': ondemand_type
|
|
|
|
})
|
|
|
|
url = '%s/zapi/watch/vod/video' % self._host_url()
|
2018-04-30 12:48:21 -06:00
|
|
|
else:
|
2022-04-08 00:44:58 -06:00
|
|
|
url = '%s/zapi/v3/watch/replay/%s/%s' % (self._host_url(), cid, video_id)
|
2017-11-05 10:07:35 -07:00
|
|
|
formats = []
|
2022-04-08 00:44:58 -06:00
|
|
|
subtitles = {}
|
|
|
|
for stream_type in ('dash', 'hls7'):
|
2018-04-30 12:48:21 -06:00
|
|
|
postdata = postdata_common.copy()
|
|
|
|
postdata['stream_type'] = stream_type
|
|
|
|
|
|
|
|
data = self._download_json(
|
|
|
|
url, video_id, 'Downloading %s formats' % stream_type.upper(),
|
|
|
|
data=urlencode_postdata(postdata), fatal=False)
|
|
|
|
if not data:
|
|
|
|
continue
|
|
|
|
|
|
|
|
watch_urls = try_get(
|
|
|
|
data, lambda x: x['stream']['watch_urls'], list)
|
|
|
|
if not watch_urls:
|
|
|
|
continue
|
|
|
|
|
|
|
|
for watch in watch_urls:
|
|
|
|
if not isinstance(watch, dict):
|
|
|
|
continue
|
2018-07-21 06:08:28 -06:00
|
|
|
watch_url = url_or_none(watch.get('url'))
|
|
|
|
if not watch_url:
|
2018-04-30 12:48:21 -06:00
|
|
|
continue
|
|
|
|
audio_channel = watch.get('audio_channel')
|
|
|
|
preference = 1 if audio_channel == 'A' else None
|
2021-11-05 19:05:24 -06:00
|
|
|
format_id = join_nonempty(stream_type, watch.get('maxrate'), audio_channel)
|
2022-04-08 00:44:58 -06:00
|
|
|
if stream_type.startswith('dash'):
|
|
|
|
this_formats, subs = self._extract_mpd_formats_and_subtitles(
|
2018-04-30 12:48:21 -06:00
|
|
|
watch_url, video_id, mpd_id=format_id, fatal=False)
|
2022-04-08 00:44:58 -06:00
|
|
|
self._merge_subtitles(subs, target=subtitles)
|
|
|
|
elif stream_type.startswith('hls'):
|
|
|
|
this_formats, subs = self._extract_m3u8_formats_and_subtitles(
|
2018-04-30 12:48:21 -06:00
|
|
|
watch_url, video_id, 'mp4',
|
|
|
|
entry_protocol='m3u8_native', m3u8_id=format_id,
|
|
|
|
fatal=False)
|
2022-04-08 00:44:58 -06:00
|
|
|
self._merge_subtitles(subs, target=subtitles)
|
2018-04-30 12:48:21 -06:00
|
|
|
elif stream_type == 'hds':
|
|
|
|
this_formats = self._extract_f4m_formats(
|
|
|
|
watch_url, video_id, f4m_id=format_id, fatal=False)
|
|
|
|
elif stream_type == 'smooth_playready':
|
|
|
|
this_formats = self._extract_ism_formats(
|
|
|
|
watch_url, video_id, ism_id=format_id, fatal=False)
|
|
|
|
else:
|
|
|
|
assert False
|
|
|
|
for this_format in this_formats:
|
2021-02-18 15:03:16 -07:00
|
|
|
this_format['quality'] = preference
|
2018-04-30 12:48:21 -06:00
|
|
|
formats.extend(this_formats)
|
2022-04-08 00:44:58 -06:00
|
|
|
return formats, subtitles
|
2017-11-05 10:07:35 -07:00
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_video(self, video_id, record_id=None):
|
|
|
|
cid, info_dict = self._extract_cid_and_video_info(video_id)
|
|
|
|
info_dict['formats'], info_dict['subtitles'] = self._extract_formats(cid, video_id, record_id=record_id)
|
2017-11-05 10:07:35 -07:00
|
|
|
return info_dict
|
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_live(self, channel_name):
|
|
|
|
cid = self._extract_cid(channel_name, channel_name)
|
|
|
|
formats, subtitles = self._extract_formats(cid, cid, is_live=True)
|
|
|
|
return {
|
|
|
|
'id': channel_name,
|
|
|
|
'title': channel_name,
|
|
|
|
'is_live': True,
|
2022-05-27 10:29:19 -06:00
|
|
|
'formats': formats,
|
2022-04-08 00:44:58 -06:00
|
|
|
'subtitles': subtitles
|
|
|
|
}
|
2017-11-05 10:07:35 -07:00
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_record(self, record_id):
|
|
|
|
video_id = self._extract_video_id_from_recording(record_id)
|
|
|
|
cid, info_dict = self._extract_cid_and_video_info(video_id)
|
|
|
|
info_dict['formats'], info_dict['subtitles'] = self._extract_formats(cid, video_id, record_id=record_id)
|
|
|
|
return info_dict
|
2018-04-30 12:48:21 -06:00
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
def _extract_ondemand(self, ondemand_id):
|
|
|
|
ondemand_termtoken, ondemand_type, info_dict = self._extract_ondemand_info(ondemand_id)
|
|
|
|
info_dict['formats'], info_dict['subtitles'] = self._extract_formats(
|
|
|
|
None, ondemand_id, ondemand_id=ondemand_id,
|
|
|
|
ondemand_termtoken=ondemand_termtoken, ondemand_type=ondemand_type)
|
|
|
|
return info_dict
|
2018-04-30 12:48:21 -06:00
|
|
|
|
2022-08-12 01:20:43 -06:00
|
|
|
def _real_extract(self, url):
|
2022-08-14 14:23:42 -06:00
|
|
|
video_id, record_id = self._match_valid_url(url).groups()
|
2022-08-18 13:57:51 -06:00
|
|
|
return getattr(self, f'_extract_{self._TYPE}')(video_id or record_id)
|
2022-08-12 01:20:43 -06:00
|
|
|
|
2017-11-05 10:07:35 -07:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
def _create_valid_url(host, match, qs, base_re=None):
|
|
|
|
match_base = fr'|{base_re}/(?P<vid1>{match})' if base_re else '(?P<vid1>)'
|
|
|
|
return rf'''(?x)https?://(?:www\.)?{re.escape(host)}/(?:
|
|
|
|
[^?#]+\?(?:[^#]+&)?{qs}=(?P<vid2>{match})
|
|
|
|
{match_base}
|
|
|
|
)'''
|
2017-11-05 10:07:35 -07:00
|
|
|
|
|
|
|
|
2018-09-23 10:30:18 -06:00
|
|
|
class ZattooBaseIE(ZattooPlatformBaseIE):
|
|
|
|
_NETRC_MACHINE = 'zattoo'
|
|
|
|
_HOST = 'zattoo.com'
|
|
|
|
|
|
|
|
|
2017-11-05 10:07:35 -07:00
|
|
|
class ZattooIE(ZattooBaseIE):
|
2022-08-18 13:57:51 -06:00
|
|
|
_VALID_URL = _create_valid_url(ZattooBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
2022-04-08 00:44:58 -06:00
|
|
|
_TYPE = 'video'
|
2017-11-05 10:07:35 -07:00
|
|
|
_TESTS = [{
|
2022-04-08 00:44:58 -06:00
|
|
|
'url': 'https://zattoo.com/program/zdf/250170418',
|
|
|
|
'info_dict': {
|
|
|
|
'id': '250170418',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'Markus Lanz',
|
|
|
|
'description': 'md5:e41cb1257de008ca62a73bb876ffa7fc',
|
|
|
|
'thumbnail': 're:http://images.zattic.com/cms/.+/format_480x360.jpg',
|
|
|
|
'creator': 'ZDF HD',
|
|
|
|
'release_year': 2022,
|
|
|
|
'episode': 'Folge 1655',
|
|
|
|
'categories': 'count:1',
|
|
|
|
'tags': 'count:2'
|
|
|
|
},
|
|
|
|
'params': {'skip_download': 'm3u8'}
|
|
|
|
}, {
|
|
|
|
'url': 'https://zattoo.com/program/daserste/210177916',
|
2017-11-05 10:07:35 -07:00
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
2022-04-08 00:44:58 -06:00
|
|
|
'url': 'https://zattoo.com/guide/german?channel=srf1&program=169860555',
|
2017-11-05 10:07:35 -07:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class ZattooLiveIE(ZattooBaseIE):
|
2022-08-18 13:57:51 -06:00
|
|
|
_VALID_URL = _create_valid_url(ZattooBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
2022-04-08 00:44:58 -06:00
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://zattoo.com/channels/german?channel=srf_zwei',
|
2017-11-05 10:07:35 -07:00
|
|
|
'only_matching': True,
|
2022-04-08 00:44:58 -06:00
|
|
|
}, {
|
|
|
|
'url': 'https://zattoo.com/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2017-11-05 10:07:35 -07:00
|
|
|
|
2018-04-30 12:48:21 -06:00
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
2022-04-08 00:44:58 -06:00
|
|
|
return False if ZattooIE.suitable(url) else super().suitable(url)
|
2018-04-30 12:48:21 -06:00
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
|
|
|
|
class ZattooMoviesIE(ZattooBaseIE):
|
2022-08-18 13:57:51 -06:00
|
|
|
_VALID_URL = _create_valid_url(ZattooBaseIE._HOST, r'\w+', 'movie_id', 'vod/movies')
|
2022-04-08 00:44:58 -06:00
|
|
|
_TYPE = 'ondemand'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://zattoo.com/vod/movies/7521',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://zattoo.com/ondemand?movie_id=7521&term_token=9f00f43183269484edde',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2018-09-23 10:30:18 -06:00
|
|
|
|
|
|
|
|
2022-04-08 00:44:58 -06:00
|
|
|
class ZattooRecordingsIE(ZattooBaseIE):
|
2022-08-18 13:57:51 -06:00
|
|
|
_VALID_URL = _create_valid_url('zattoo.com', r'\d+', 'recording')
|
2022-04-08 00:44:58 -06:00
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://zattoo.com/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://zattoo.com/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class NetPlusTVBaseIE(ZattooPlatformBaseIE):
|
2022-08-18 17:28:54 -06:00
|
|
|
_NETRC_MACHINE = 'netplus'
|
2018-09-23 10:30:18 -06:00
|
|
|
_HOST = 'netplus.tv'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class NetPlusTVIE(NetPlusTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(NetPlusTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://netplus.tv/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://netplus.tv/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class NetPlusTVLiveIE(NetPlusTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(NetPlusTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://netplus.tv/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://netplus.tv/live/srf1',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if NetPlusTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class NetPlusTVRecordingsIE(NetPlusTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(NetPlusTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://netplus.tv/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://netplus.tv/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class MNetTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'mnettv'
|
|
|
|
_HOST = 'tvplus.m-net.de'
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class MNetTVIE(MNetTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(MNetTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvplus.m-net.de/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvplus.m-net.de/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class MNetTVLiveIE(MNetTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(MNetTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvplus.m-net.de/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvplus.m-net.de/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if MNetTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class MNetTVRecordingsIE(MNetTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(MNetTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://tvplus.m-net.de/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvplus.m-net.de/tc/ptc_recordings_all_recordings?recording=193615420',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class WalyTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'walytv'
|
|
|
|
_HOST = 'player.waly.tv'
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class WalyTVIE(WalyTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(WalyTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://player.waly.tv/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://player.waly.tv/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class WalyTVLiveIE(WalyTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(WalyTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://player.waly.tv/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://player.waly.tv/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if WalyTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class WalyTVRecordingsIE(WalyTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(WalyTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://player.waly.tv/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://player.waly.tv/tc/ptc_recordings_all_recordings?recording=193615420',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class BBVTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'bbvtv'
|
|
|
|
_HOST = 'bbv-tv.net'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class BBVTVIE(BBVTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(BBVTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://bbv-tv.net/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://bbv-tv.net/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class BBVTVLiveIE(BBVTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(BBVTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://bbv-tv.net/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://bbv-tv.net/live/srf1',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if BBVTVIE.suitable(url) else super().suitable(url)
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class BBVTVRecordingsIE(BBVTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(BBVTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://bbv-tv.net/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://bbv-tv.net/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class VTXTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'vtxtv'
|
|
|
|
_HOST = 'vtxtv.ch'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class VTXTVIE(VTXTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(VTXTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://vtxtv.ch/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://vtxtv.ch/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class VTXTVLiveIE(VTXTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(VTXTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://vtxtv.ch/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://vtxtv.ch/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if VTXTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class VTXTVRecordingsIE(VTXTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(VTXTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://vtxtv.ch/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://vtxtv.ch/tc/ptc_recordings_all_recordings?recording=193615420',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class GlattvisionTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'glattvisiontv'
|
|
|
|
_HOST = 'iptv.glattvision.ch'
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class GlattvisionTVIE(GlattvisionTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(GlattvisionTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://iptv.glattvision.ch/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://iptv.glattvision.ch/guide/german?channel=srf1&program=169860555',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class GlattvisionTVLiveIE(GlattvisionTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(GlattvisionTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://iptv.glattvision.ch/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://iptv.glattvision.ch/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if GlattvisionTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class GlattvisionTVRecordingsIE(GlattvisionTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(GlattvisionTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://iptv.glattvision.ch/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://iptv.glattvision.ch/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class SAKTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'saktv'
|
|
|
|
_HOST = 'saktv.ch'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class SAKTVIE(SAKTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SAKTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://saktv.ch/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://saktv.ch/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class SAKTVLiveIE(SAKTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SAKTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://saktv.ch/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://saktv.ch/live/srf1',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if SAKTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class SAKTVRecordingsIE(SAKTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SAKTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://saktv.ch/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://saktv.ch/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class EWETVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'ewetv'
|
|
|
|
_HOST = 'tvonline.ewe.de'
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class EWETVIE(EWETVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EWETVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvonline.ewe.de/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.ewe.de/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class EWETVLiveIE(EWETVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EWETVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvonline.ewe.de/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.ewe.de/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if EWETVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class EWETVRecordingsIE(EWETVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EWETVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://tvonline.ewe.de/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.ewe.de/tc/ptc_recordings_all_recordings?recording=193615420',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class QuantumTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'quantumtv'
|
|
|
|
_HOST = 'quantum-tv.com'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class QuantumTVIE(QuantumTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(QuantumTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://quantum-tv.com/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://quantum-tv.com/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class QuantumTVLiveIE(QuantumTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(QuantumTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://quantum-tv.com/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://quantum-tv.com/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if QuantumTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class QuantumTVRecordingsIE(QuantumTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(QuantumTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://quantum-tv.com/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://quantum-tv.com/tc/ptc_recordings_all_recordings?recording=193615420',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class OsnatelTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = 'osnateltv'
|
2018-11-05 03:09:57 -07:00
|
|
|
_HOST = 'tvonline.osnatel.de'
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class OsnatelTVIE(OsnatelTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(OsnatelTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvonline.osnatel.de/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.osnatel.de/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class OsnatelTVLiveIE(OsnatelTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(OsnatelTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://tvonline.osnatel.de/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.osnatel.de/live/srf1',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if OsnatelTVIE.suitable(url) else super().suitable(url)
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class OsnatelTVRecordingsIE(OsnatelTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(OsnatelTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tvonline.osnatel.de/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tvonline.osnatel.de/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class EinsUndEinsTVBaseIE(ZattooPlatformBaseIE):
|
2018-09-23 10:30:18 -06:00
|
|
|
_NETRC_MACHINE = '1und1tv'
|
|
|
|
_HOST = '1und1.tv'
|
2018-11-05 01:52:46 -07:00
|
|
|
_API_HOST = 'www.%s' % _HOST
|
2018-09-23 10:30:18 -06:00
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class EinsUndEinsTVIE(EinsUndEinsTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EinsUndEinsTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
2018-09-23 10:30:18 -06:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://1und1.tv/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://1und1.tv/guide/german?channel=srf1&program=169860555',
|
2018-09-23 10:30:18 -06:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2019-01-28 12:20:46 -07:00
|
|
|
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
class EinsUndEinsTVLiveIE(EinsUndEinsTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EinsUndEinsTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://1und1.tv/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://1und1.tv/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if EinsUndEinsTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class EinsUndEinsTVRecordingsIE(EinsUndEinsTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(EinsUndEinsTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://1und1.tv/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://1und1.tv/tc/ptc_recordings_all_recordings?recording=193615420',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class SaltTVBaseIE(ZattooPlatformBaseIE):
|
2019-01-28 12:20:46 -07:00
|
|
|
_NETRC_MACHINE = 'salttv'
|
|
|
|
_HOST = 'tv.salt.ch'
|
|
|
|
|
2022-08-18 13:57:51 -06:00
|
|
|
|
|
|
|
class SaltTVIE(SaltTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SaltTVBaseIE._HOST, r'\d+', 'program', '(?:program|watch)/[^/]+')
|
|
|
|
_TYPE = 'video'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tv.salt.ch/program/daserste/210177916',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tv.salt.ch/guide/german?channel=srf1&program=169860555',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
class SaltTVLiveIE(SaltTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SaltTVBaseIE._HOST, r'[^/?&#]+', 'channel', 'live')
|
|
|
|
_TYPE = 'live'
|
2019-01-28 12:20:46 -07:00
|
|
|
_TESTS = [{
|
2022-08-18 13:57:51 -06:00
|
|
|
'url': 'https://tv.salt.ch/channels/german?channel=srf_zwei',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tv.salt.ch/live/srf1',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def suitable(cls, url):
|
|
|
|
return False if SaltTVIE.suitable(url) else super().suitable(url)
|
|
|
|
|
|
|
|
|
|
|
|
class SaltTVRecordingsIE(SaltTVBaseIE):
|
|
|
|
_VALID_URL = _create_valid_url(SaltTVBaseIE._HOST, r'\d+', 'recording')
|
|
|
|
_TYPE = 'record'
|
|
|
|
_TESTS = [{
|
|
|
|
'url': 'https://tv.salt.ch/recordings?recording=193615508',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'https://tv.salt.ch/tc/ptc_recordings_all_recordings?recording=193615420',
|
2019-01-28 12:20:46 -07:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|