U
    gSr                     @   s  d dl Z d dlZddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZmZ G dd deZdud	d
ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd  d eZG d!d" d"eZG d#d$ d$eZG d%d& d&eZG d'd( d(eZG d)d* d*eZG d+d, d,eZG d-d. d.eZ G d/d0 d0e Z!G d1d2 d2e Z"G d3d4 d4e Z#G d5d6 d6eZ$G d7d8 d8e$Z%G d9d: d:e$Z&G d;d< d<e$Z'G d=d> d>eZ(G d?d@ d@e(Z)G dAdB dBe(Z*G dCdD dDe(Z+G dEdF dFeZ,G dGdH dHe,Z-G dIdJ dJe,Z.G dKdL dLe,Z/G dMdN dNeZ0G dOdP dPe0Z1G dQdR dRe0Z2G dSdT dTe0Z3G dUdV dVeZ4G dWdX dXe4Z5G dYdZ dZe4Z6G d[d\ d\e4Z7G d]d^ d^eZ8G d_d` d`e8Z9G dadb dbe8Z:G dcdd dde8Z;G dedf dfeZ<G dgdh dhe<Z=G didj dje<Z>G dkdl dle<Z?G dmdn dneZ@G dodp dpe@ZAG dqdr dre@ZBG dsdt dte@ZCdS )v    N   )InfoExtractor   )	HTTPError)ExtractorErrorint_or_nonejoin_nonemptytry_geturl_or_noneurlencode_postdatac                   @   s   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd ZdddZd ddZdd Zdd Zdd Zdd ZdS )!ZattooPlatformBaseIENc                 C   s   dt | dr| jn| j S )Nz
https://%s	_API_HOST)hasattrr   _HOSTself r   ;/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/zattoo.py	_host_url   s    zZattooPlatformBaseIE._host_urlc                 C   s   | j s| jddd d S )Nz)An account is needed to access this mediapassword)method)_power_guide_hashZraise_login_requiredr   r   r   r   _real_initialize   s    z%ZattooPlatformBaseIE._real_initializec              
   C   s   z>| j |   dd dt||dd|   dddd}W nH tk
r } z*t|jtrt|jjd	krttd
dd W 5 d }~X Y nX |d d | _d S )Nz/zapi/v2/account/loginz
Logging intrue)loginr   Zrememberz/loginz0application/x-www-form-urlencoded; charset=UTF-8)ZRefererzContent-Type)dataheadersi  z3Unable to login: incorrect username and/or passwordT)expectedsessionZpower_guide_hash)	_download_jsonr   r   r   
isinstancecauser   statusr   )r   usernamer   r   er   r   r   _perform_login   s,      

z#ZattooPlatformBaseIE._perform_loginc                 C   sT   |  |   dd dd }| j|   dd dttt ddd|d	d
 d S )Nz/token.jsonzDownloading session tokensession_tokenz/zapi/v3/session/hellozOpening sessionenz1.8.2json)uuidlangZapp_versionformatZclient_app_token)r   )r   r   Z_request_webpager   strr)   Zuuid4)r   r&   r   r   r   _initialize_pre_login/   s&        
z*ZattooPlatformBaseIE._initialize_pre_loginc              	      sZ   |  |   d d}zt fdd|d D W S  ttfk
rT   tdY nX d S )Nz/zapi/v2/playlistzDownloading playlistc                 3   s6   | ].}| d rt| d krt|d  V  qdS )Z
program_ididN)getr,   ).0itemrecidr   r   	<genexpr>B   s   
 zHZattooPlatformBaseIE._extract_video_id_from_recording.<locals>.<genexpr>Z
recordingsz)Could not extract video id from recording)r   r   nextStopIterationKeyErrorr   )r   r3   Zplaylistr   r2   r    _extract_video_id_from_recording>   s      
z5ZattooPlatformBaseIE._extract_video_id_from_recordingc                    s   | j |   d| j |dddidd }g }|D ]}||d  q2zt fdd	|D W S  tk
rz   td
Y nX d S )Nz/zapi/v2/cached/channels/zDownloading channel listdetailsFquerychannel_groupsZchannelsc                 3   s<   | ]4}| d r| d ks,| d  kr|d  V  qdS )cidZdisplay_aliasN)r/   )r0   Zchanchannel_namer   r   r4   Q   s
   
z4ZattooPlatformBaseIE._extract_cid.<locals>.<genexpr>zCould not extract channel id)r   r   r   extendr5   r6   r   )r   video_idr?   r<   Zchannel_listZchgrpr   r>   r   _extract_cidH   s"     
z!ZattooPlatformBaseIE._extract_cidc                 C   s   | j |   d| j |d|ddd}|d d }|d }||d	pN|d
 |d|d|d|d
t|dt|dt|dt|dd tt|dd td}||fS )Nz&/zapi/v2/cached/program/power_details/zDownloading video informationT)Zprogram_idsZcompleter:   Zprogramsr   r=   tetdZi_urlr?   Ze_noZs_noyearc                 S   s   | d S )Ncr   xr   r   r   <lambda>p       zBZattooPlatformBaseIE._extract_cid_and_video_info.<locals>.<lambda>c                 S   s   | d S )Ngr   rH   r   r   r   rJ   q   rK   )r.   titledescription	thumbnailcreatorepisodeepisode_numberseason_numberrelease_year
categoriestags)r   r   r   r/   r   r	   list)r   rA   r   pr=   	info_dictr   r   r   _extract_cid_and_video_infoY   s.    	z0ZattooPlatformBaseIE._extract_cid_and_video_infoc                 C   s   |  |   d| |d}||d|dt|dt|dt|dt|dt|d	d
 td}|d d d d d |d |fS )zH
        @returns    (ondemand_token, ondemand_type, info_dict)
        z/zapi/vod/movies/z Downloading ondemand informationrM   rN   durationrF   rR   rS   c                 S   s   | d S )NrU   r   rH   r   r   r   rJ      rK   z=ZattooPlatformBaseIE._extract_ondemand_info.<locals>.<lambda>)r.   rM   rN   r[   rT   rR   rS   rU   Zterms_catalogr   Ztermstokentype)r   r   r/   r   r	   rW   )r   ondemand_idr   rY   r   r   r   _extract_ondemand_infov   s     
z+ZattooPlatformBaseIE._extract_ondemand_infoFc              
   C   s  ddi}|r.| ddi |   d| }	nV|rF|   d| }	n>|rl| |||d |   d}	n|   d	| d
| }	g }
i }dD ]|}| }||d< | j|	|d|  dt|dd}|sqt|dd t}|sq|D ] }t|t	sqt
|d}|sq|d}|dkr*dnd }t||d|}|drr| j|||dd\}}| j||d n||dr| j||dd|dd\}}| j||d nF|dkr| j|||dd }n(|d!kr| j|||dd"}n
dst|D ]}||d#< q|
| qq|
|fS )$NZhttps_watch_urlsTZ	timeshifti0*  z/zapi/watch/live/z/zapi/watch/recording/)Zteasable_idZ
term_tokenZteasable_typez/zapi/watch/vod/videoz/zapi/v3/watch/replay//)dashZhls7stream_typezDownloading z formatsF)r   fatalc                 S   s   | d d S )Nstream
watch_urlsr   rH   r   r   r   rJ      rK   z7ZattooPlatformBaseIE._extract_formats.<locals>.<lambda>urlaudio_channelAr   Zmaxratera   )Zmpd_idrc   )targetZhlsmp4Zm3u8_native)Zentry_protocolZm3u8_idrc   Zhds)Zf4m_idrc   Zsmooth_playready)Zism_idrc   Zquality)updater   copyr   upperr   r	   rW   r    dictr
   r/   r   
startswithZ"_extract_mpd_formats_and_subtitlesZ_merge_subtitlesZ#_extract_m3u8_formats_and_subtitlesZ_extract_f4m_formatsZ_extract_ism_formatsAssertionErrorr@   )r   r=   rA   	record_idr^   ondemand_termtokenondemand_typeis_liveZpostdata_commonrf   formats	subtitlesrb   Zpostdatar   re   ZwatchZ	watch_urlrg   Z
preferenceZ	format_idZthis_formatssubsZthis_formatr   r   r   _extract_formats   s     
     


   
   

   
   
z%ZattooPlatformBaseIE._extract_formatsc                 C   s.   |  |\}}| j|||d\|d< |d< |S N)rq   ru   rv   )rZ   rx   )r   rA   rq   r=   rY   r   r   r   _extract_video   s    z#ZattooPlatformBaseIE._extract_videoc                 C   s0   |  ||}| j||dd\}}||d||dS )NT)rt   )r.   rM   rt   ru   rv   )rB   rx   )r   r?   r=   ru   rv   r   r   r   _extract_live   s    z"ZattooPlatformBaseIE._extract_livec                 C   s8   |  |}| |\}}| j|||d\|d< |d< |S ry   )r8   rZ   rx   )r   rq   rA   r=   rY   r   r   r   _extract_record   s    
z$ZattooPlatformBaseIE._extract_recordc                 C   s4   |  |\}}}| jd ||||d\|d< |d< |S )N)r^   rr   rs   ru   rv   )r_   rx   )r   r^   rr   rs   rY   r   r   r   _extract_ondemand   s       z&ZattooPlatformBaseIE._extract_ondemandc                 C   s,   |  | \}}t| d| j |p(|S )NZ	_extract_)Z_match_valid_urlgroupsgetattr_TYPE)r   rf   rA   rq   r   r   r   _real_extract   s    z"ZattooPlatformBaseIE._real_extract)NNNNF)N)__name__
__module____qualname__r   r   r   r%   r-   r8   rB   rZ   r_   rx   rz   r{   r|   r}   r   r   r   r   r   r      s   

D
r   c              	   C   s>   |rd| d| dnd}dt |  d| d| d| d		S )
N|z
/(?P<vid1>)z
(?P<vid1>)z(?x)https?://(?:www\.)?z /(?:
        [^?#]+\?(?:[^#]+&)?z
=(?P<vid2>z
)
        z
    ))reescape)hostmatchqsZbase_reZ
match_baser   r   r   _create_valid_url   s    r   c                   @   s   e Zd ZdZdZdS )ZattooBaseIEZzattoo
zattoo.comNr   r   r   _NETRC_MACHINEr   r   r   r   r   r      s   r   c                   @   sX   e Zd ZeejdddZdZddddd	d
dddddd
ddidddddddgZdS )ZattooIE\d+program(?:program|watch)/[^/]+videoz(https://zattoo.com/program/zdf/250170418Z	250170418rj   zMarkus Lanzz$md5:e41cb1257de008ca62a73bb876ffa7fcz5re:http://images.zattic.com/cms/.+/format_480x360.jpgzZDF HDi  z
Folge 1655zcount:1zcount:2)
r.   extrM   rN   rO   rP   rT   rQ   rU   rV   Zskip_downloadZm3u8)rf   rY   paramsz-https://zattoo.com/program/daserste/210177916Trf   Zonly_matchingz>https://zattoo.com/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   
_VALID_URLr   _TESTSr   r   r   r   r      s.   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
ZattooLiveIE[^/?&#]+channellivez3https://zattoo.com/channels/german?channel=srf_zweiTr   zhttps://zattoo.com/live/srf1c                    s   t |rdS t |S NF)r   suitablesuperclsrf   	__class__r   r   r   "  s    zZattooLiveIE.suitable)r   r   r   r   r   r   r   r   r   classmethodr   __classcell__r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
ZattooMoviesIEz\w+Zmovie_idz
vod/moviesZondemandz"https://zattoo.com/vod/movies/7521Tr   zIhttps://zattoo.com/ondemand?movie_id=7521&term_token=9f00f43183269484eddeNr   r   r   r   r   r   '  s   r   c                   @   s0   e Zd ZedddZdZddddddgZd	S )
ZattooRecordingsIEr   r   	recordingrecordz1https://zattoo.com/recordings?recording=193615508Tr   zGhttps://zattoo.com/tc/ptc_recordings_all_recordings?recording=193615420N)r   r   r   r   r   r   r   r   r   r   r   r   3  s   r   c                   @   s   e Zd ZdZdZde ZdS )NetPlusTVBaseIEZnetplusz
netplus.tvwww.Nr   r   r   r   r   r   r   r   r   r   r   ?  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
NetPlusTVIEr   r   r   r   z-https://netplus.tv/program/daserste/210177916Tr   z>https://netplus.tv/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r   E  s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
NetPlusTVLiveIEr   r   r   z3https://netplus.tv/channels/german?channel=srf_zweiTr   zhttps://netplus.tv/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r   \  s    zNetPlusTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Q  s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	NetPlusTVRecordingsIEr   r   r   z1https://netplus.tv/recordings?recording=193615508Tr   zGhttps://netplus.tv/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r   a  s   r   c                   @   s   e Zd ZdZdZdS )MNetTVBaseIEZmnettvztvplus.m-net.deNr   r   r   r   r   r   m  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
MNetTVIEr   r   r   r   z2https://tvplus.m-net.de/program/daserste/210177916Tr   zChttps://tvplus.m-net.de/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
MNetTVLiveIEr   r   r   z8https://tvplus.m-net.de/channels/german?channel=srf_zweiTr   z!https://tvplus.m-net.de/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zMNetTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ~  s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	MNetTVRecordingsIEr   r   r   z6https://tvplus.m-net.de/recordings?recording=193615508Tr   zLhttps://tvplus.m-net.de/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZdS )WalyTVBaseIEZwalytvzplayer.waly.tvNr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
WalyTVIEr   r   r   r   z1https://player.waly.tv/program/daserste/210177916Tr   zBhttps://player.waly.tv/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
WalyTVLiveIEr   r   r   z7https://player.waly.tv/channels/german?channel=srf_zweiTr   z https://player.waly.tv/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zWalyTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	WalyTVRecordingsIEr   r   r   z5https://player.waly.tv/recordings?recording=193615508Tr   zKhttps://player.waly.tv/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZde ZdS )BBVTVBaseIEZbbvtvz
bbv-tv.netr   Nr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
BBVTVIEr   r   r   r   z-https://bbv-tv.net/program/daserste/210177916Tr   z>https://bbv-tv.net/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
BBVTVLiveIEr   r   r   z3https://bbv-tv.net/channels/german?channel=srf_zweiTr   zhttps://bbv-tv.net/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zBBVTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	BBVTVRecordingsIEr   r   r   z1https://bbv-tv.net/recordings?recording=193615508Tr   zGhttps://bbv-tv.net/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZde ZdS )VTXTVBaseIEZvtxtvzvtxtv.chr   Nr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
VTXTVIEr   r   r   r   z+https://vtxtv.ch/program/daserste/210177916Tr   z<https://vtxtv.ch/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
VTXTVLiveIEr   r   r   z1https://vtxtv.ch/channels/german?channel=srf_zweiTr   zhttps://vtxtv.ch/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zVTXTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	VTXTVRecordingsIEr   r   r   z/https://vtxtv.ch/recordings?recording=193615508Tr   zEhttps://vtxtv.ch/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZdS )GlattvisionTVBaseIEZglattvisiontvziptv.glattvision.chNr   r   r   r   r   r   #  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
GlattvisionTVIEr   r   r   r   z6https://iptv.glattvision.ch/program/daserste/210177916Tr   zGhttps://iptv.glattvision.ch/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r   (  s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
GlattvisionTVLiveIEr   r   r   z<https://iptv.glattvision.ch/channels/german?channel=srf_zweiTr   z%https://iptv.glattvision.ch/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r   ?  s    zGlattvisionTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   4  s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	GlattvisionTVRecordingsIEr   r   r   z:https://iptv.glattvision.ch/recordings?recording=193615508Tr   zPhttps://iptv.glattvision.ch/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r   D  s   r   c                   @   s   e Zd ZdZdZde ZdS )SAKTVBaseIEZsaktvzsaktv.chr   Nr   r   r   r   r   r   P  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
SAKTVIEr   r   r   r   z+https://saktv.ch/program/daserste/210177916Tr   z<https://saktv.ch/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r   V  s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
SAKTVLiveIEr   r   r   z1https://saktv.ch/channels/german?channel=srf_zweiTr   zhttps://saktv.ch/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r   m  s    zSAKTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   b  s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	SAKTVRecordingsIEr   r   r   z/https://saktv.ch/recordings?recording=193615508Tr   zEhttps://saktv.ch/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r   r  s   r   c                   @   s   e Zd ZdZdZdS )EWETVBaseIEZewetvztvonline.ewe.deNr   r   r   r   r   r   ~  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
EWETVIEr   r   r   r   z2https://tvonline.ewe.de/program/daserste/210177916Tr   zChttps://tvonline.ewe.de/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
EWETVLiveIEr   r   r   z8https://tvonline.ewe.de/channels/german?channel=srf_zweiTr   z!https://tvonline.ewe.de/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zEWETVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	EWETVRecordingsIEr   r   r   z6https://tvonline.ewe.de/recordings?recording=193615508Tr   zLhttps://tvonline.ewe.de/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZde ZdS )QuantumTVBaseIEZ	quantumtvzquantum-tv.comr   Nr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
QuantumTVIEr   r   r   r   z1https://quantum-tv.com/program/daserste/210177916Tr   zBhttps://quantum-tv.com/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
QuantumTVLiveIEr   r   r   z7https://quantum-tv.com/channels/german?channel=srf_zweiTr   z https://quantum-tv.com/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zQuantumTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	QuantumTVRecordingsIEr   r   r   z5https://quantum-tv.com/recordings?recording=193615508Tr   zKhttps://quantum-tv.com/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZdS )OsnatelTVBaseIEZ	osnateltvztvonline.osnatel.deNr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
OsnatelTVIEr   r   r   r   z6https://tvonline.osnatel.de/program/daserste/210177916Tr   zGhttps://tvonline.osnatel.de/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
OsnatelTVLiveIEr   r   r   z<https://tvonline.osnatel.de/channels/german?channel=srf_zweiTr   z%https://tvonline.osnatel.de/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r     s    zOsnatelTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	OsnatelTVRecordingsIEr   r   r   z:https://tvonline.osnatel.de/recordings?recording=193615508Tr   zPhttps://tvonline.osnatel.de/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r     s   r   c                   @   s   e Zd ZdZdZde ZdS )EinsUndEinsTVBaseIEZ1und1tvz1und1.tvr   Nr   r   r   r   r   r     s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
EinsUndEinsTVIEr   r   r   r   z+https://1und1.tv/program/daserste/210177916Tr   z<https://1und1.tv/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
EinsUndEinsTVLiveIEr   r   r   z1https://1und1.tv/channels/german?channel=srf_zweiTr   zhttps://1und1.tv/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r   #  s    zEinsUndEinsTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	EinsUndEinsTVRecordingsIEr   r   r   z/https://1und1.tv/recordings?recording=193615508Tr   zEhttps://1und1.tv/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r   (  s   r   c                   @   s   e Zd ZdZdZdS )SaltTVBaseIEZsalttvz
tv.salt.chNr   r   r   r   r   r   4  s   r   c                   @   s4   e Zd ZeejdddZdZddddddgZd	S )
SaltTVIEr   r   r   r   z-https://tv.salt.ch/program/daserste/210177916Tr   z>https://tv.salt.ch/guide/german?channel=srf1&program=169860555N	r   r   r   r   r   r   r   r   r   r   r   r   r   r   9  s   r   c                       sH   e Zd ZeejdddZdZddddddgZe	 fdd	Z
  ZS )
SaltTVLiveIEr   r   r   z3https://tv.salt.ch/channels/german?channel=srf_zweiTr   zhttps://tv.salt.ch/live/srf1c                    s   t |rdS t |S r   )r   r   r   r   r   r   r   r   P  s    zSaltTVLiveIE.suitable)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   E  s   r   c                   @   s2   e Zd ZeejddZdZddddddgZdS )	SaltTVRecordingsIEr   r   r   z1https://tv.salt.ch/recordings?recording=193615508Tr   zGhttps://tv.salt.ch/tc/ptc_recordings_all_recordings?recording=193615420Nr   r   r   r   r   r   U  s   r   )N)Dr   r)   commonr   Znetworking.exceptionsr   utilsr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   sx    
 `
