
    Ği                        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mZmZ ddlmZ  G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d  d!e          Z G d" d#e          Z G d$ d%e          Z G d& d'e          Z  G d( d)e          Z! G d* d+e          Z" G d, d-e          Z# G d. d/e          Z$ G d0 d1e          Z% G d2 d3e$          Z& G d4 d5e$          Z'dS )6    N   )InfoExtractor   )	HTTPError)ExtractorErrordetermine_extfloat_or_noneint_or_noneremove_startstrip_or_nonetry_getunified_timestamp)traverse_objc                   8    e Zd ZdZi Zd
dZd Zd Zd ZddZ	d	S )DPlayBaseIEz/(?P<id>[^/]+/[^/?#]+)Tc                    ||f}|                      |                              d          }|r|j        p| j                            |          }|sd|i}|rt	          j                    j        |d<   |                     |dz   |d|          d         d         d         }|                      |                              d          s
|| j        |<   d	| S )
NstrealmdeviceIdtokenzDownloading token)querydata
attributeszBearer )_get_cookiesgetvalue_auth_token_cacheuuiduuid4hex_download_json)	self
disco_base
display_idr   needs_device_idkeyr   r   r   s	            [C:\Users\betacode\Desktop\descargarYoutube\venv\Lib\site-packages\yt_dlp/extractor/dplay.py	_get_authzDPlayBaseIE._get_auth   s    5!z**..t44DT%;%?%?%D%D 
	4e$E 5$(JLL$4j!''W$j2E (  #%%133:<E
 $$Z0044T:: 4.3&s+        c                 |   |                      |j        j                                                            d          d           }|d         d         }|                    d          }|dk    r|                     |           n|dv rt          dd	
          t          |d         d         d         d	
          )Nzutf-8errorsr   codezaccess.denied.geoblocked)	countries)zaccess.denied.missingpackagezinvalid.tokenzQThis video is only available for registered users. You may want to use --cookies.T)expecteddetail)_parse_jsoncauseresponsereaddecoder   raise_geo_restrictedr   )r"   egeo_countriesinfoerror
error_codes         r'   _process_errorszDPlayBaseIE._process_errors*   s     0 5 5 7 7 > >w G GNNXq!YYv&&
333%%%>>>>LLL cnrt t t tT(^A.x84HHHHr)   c                 <    |                      |||d          |d<   d S )NFAuthorization)r(   r"   headersr#   r$   r   s        r'   _update_disco_api_headersz%DPlayBaseIE._update_disco_api_headers5   s%    #'>>*j%QV#W#W   r)   c                     |                      |dz   |z   ||          d         d         d         }g }|                                D ]0\  }}|                    ||                    d          d           1|S )Nzplayback/videoPlaybackInfo/)r?   r   r   	streamingurl)typerC   )r!   itemsappendr   )r"   r#   video_idr?   rB   streaming_list	format_idformat_dicts           r'   _download_video_playback_infoz)DPlayBaseIE._download_video_playback_info8   s    ''66Ag ( ' ''-//;==HJ	 &/oo&7&7 	 	"I{!!!"u--# #     r)    c                 @	   |                      d          p|}|                                g}|                     d|i           d| d}d|i}	|                     |	|||           	 |                     |dz   |z   ||	ddddd	d
d          }
nS# t
          $ rF}t          |j        t                    r&|j        j	        dk    r| 
                    ||            d }~ww xY w|
d         d         }|
d         d         }|d                                         }g }i }	 |                     |||	          }nS# t
          $ rF}t          |j        t                    r&|j        j	        dk    r| 
                    ||            d }~ww xY w|D ]}t          |t                    s|                    d          }|s1|                    d          }t          |          }|dk    s|dk    rH|                     ||dd          \  }}|                    |           |                     ||          }|dk    s|dk    rJ|                     ||dddd          \  }}|                    |           |                     ||          }|                    ||d           d x}}g }g }|
                    d          pg }t          |t*                    r|D ]}|                    d          }|s|                    d          } | dk    r|                    d          }nv| d k    rp|                    d!          }!|!rY|                    |!t-          |                    d"                    t-          |                    d#                    d$           | d%k    r|                    d          }| d&k    r,|                    d          }"|"r|                    |"           |||t/          |                    d'                    t1          |                    d(          d)          t3          |                    d*                    |t-          |                    d+                    t-          |                    d,                    |||||d-|id.S )/Ngeo_bypass_countryr-   zhttps:///Refererzcontent/videos/namezheight,src,widthzFdescription,episodeNumber,name,publishStart,seasonNumber,videoDurationzimages,primaryChannel,show,tags)zfields[channel]zfields[image]zfields[show]zfields[tag]zfields[video]include)r?   r   i  r   idr   i  rC   rD   dashmpdF)mpd_idfatalhlsm3u8mp4m3u8_native)entry_protocolm3u8_idrW   )rC   rI   includedchannelimagesrcwidthheight)rC   rb   rc   showtagdescriptionvideoDurationi  publishStartseasonNumberepisodeNumberreferer)rS   r$   titlerf   duration	timestampseriesseason_numberepisode_numbercreatortags
thumbnailsformats	subtitleshttp_headers)	get_paramupper_initialize_geo_bypassr@   r!   r   
isinstancer1   r   statusr;   striprK   dictr   r   "_extract_mpd_formats_and_subtitlesextend_merge_subtitles#_extract_m3u8_formats_and_subtitlesrF   listr
   r   r	   r   )#r"   rC   r$   
disco_hostr   countrydomainr7   r#   r?   videor6   rG   r8   rl   ru   rv   rB   rJ   
format_urlrI   ext	dash_fmts	dash_subs	m3u8_fmts	m3u8_subsrr   ro   rs   rt   r^   r   e_typera   rQ   s#                                      r'   _get_disco_api_infozDPlayBaseIE._get_disco_api_infoD   sU   ..!566A' )##%
 	 	 	 .
---
s
 	&&w
JNNN	''..;Z'-%7$*#)%m@( ( ( 	 	EE  	 	 	!'9-- 7!'.C2G2G$$Q666	 =&V}\*V""$$		::Hg/ /II 	 	 	!'9-- 7!'.C2G2G$$Q666	 % 	 	Kk400 $//J #//I
++CF""cUll'+'N'N
6 (O (H (H$	9y))) 11)YGG		e##sf}}'+'O'O
E#0% (P (! (!$	9 y))) 11)YGG		%!*       
  &
99Z((.Bh%% 	* * *UU<00
! vY&&(nnV44GGw&&$..//C "))#&%01H1H%I%I&1*..2J2J&K&K+ +   
 V##'^^F33FFu__%>>&11D *D)))$(-)@)@AA%dhh&?&?FF*488N+C+CDD(.)A)ABB)$((?*C*CDD$"6
 
 	
s2   '&B 
CACCD4 4
F>AE??FN)T)rL   )
__name__
__module____qualname___PATH_REGEXr   r(   r;   r@   rK   r    r)   r'   r   r      s        +K! ! ! !&	I 	I 	IX X X
 
 
l
 l
 l
 l
 l
 l
r)   r   c                   0   e Zd Zdej        z   Zdddddddd	d
dddddddidddddddddddddddddidddddddd d!d"d#dd$d%ddid&d'd(d)d*d+dd,d-d.d/d0d1dd2dd3d4d5d6d7dd8d9d:d;d<d=d>d2dd3ddidd?dd@dAdd@dBdd@dCdd@dDdd@dEdd@dFdd@dGdd@gZdH ZdIS )JDPlayIEa9  (?x)https?://
        (?P<domain>
            (?:www\.)?(?P<host>d
                (?:
                    play\.(?P<country>dk|fi|jp|se|no)|
                    iscoveryplus\.(?P<plus_country>dk|es|fi|it|se|no)
                )
            )|
            (?P<subdomain_country>es|it)\.dplay\.com
        )/[^/]+zshttps://www.dplay.se/videos/nugammalt-77-handelser-som-format-sverige/nugammalt-77-handelser-som-format-sverige-10113628zWnugammalt-77-handelser-som-format-sverige/nugammalt-77-handelser-som-format-sverige-101rZ   u    Svensken lär sig njuta av livetz$md5:d3819c9bccffd0fe458ca42451dd50d8gʡE@i+cQ20130408zKanal 5u,   Nugammalt - 77 händelser som format Sveriger   rS   r$   r   rl   rf   rm   rn   upload_daterr   ro   rp   rq   skip_downloadTrC   	info_dictparamszShttp://www.dplay.dk/videoer/ted-bundy-mind-of-a-monster/ted-bundy-mind-of-a-monster104465z7ted-bundy-mind-of-a-monster/ted-bundy-mind-of-a-monsterzTed Bundy: Mind Of A Monsterz$md5:8b780f6f18de4dae631668b8a9637995gx@i ]20191010zID - Investigation Discoveryz=https://www.dplay.no/videoer/i-kongens-klr/sesong-1-episode-740206z i-kongens-klr/sesong-1-episode-7	Episode 7z$md5:e3e1411b2b9aebeea36a6ec5d50c60cfgQf@ijgZ20180123u   I kongens klær   )rS   r$   r   rl   rf   rm   rn   r   ro   rp   rq   Available for Premium users)rC   r   r   skipzZhttp://it.dplay.com/nove/biografie-imbarazzanti/luigi-di-maio-la-psicosi-di-stanislawskij/ 2b808ffb00fc47b884a172ca5d13053c6918z@biografie-imbarazzanti/luigi-di-maio-la-psicosi-di-stanislawskijz*Luigi Di Maio: la psicosi di Stanislawskijz$md5:3c7a4303aef85868f867a26f5cc14813zre:^https?://.*\.jpe?g20160524i 
DWzBiografie imbarazzanti	Episode 1)rS   r$   r   rl   rf   	thumbnailr   rn   ro   rp   episoderq   )rC   md5r   zChttps://es.dplay.com/dmax/la-fiebre-del-oro/temporada-8-episodio-1/21652z(la-fiebre-del-oro/temporada-8-episodio-1z
Episodio 1z$md5:b9dcff2071086e003737485210675f69zre:^https?://.*\.png20180709iC[zLa fiebre del oro   zHhttps://www.dplay.fi/videot/shifting-gears-with-aaron-kaufman/episode-16rC   only_matchingz*https://www.dplay.jp/video/gold-rush/24086z{https://www.discoveryplus.se/videos/nugammalt-77-handelser-som-format-sverige/nugammalt-77-handelser-som-format-sverige-101z\https://www.discoveryplus.dk/videoer/ted-bundy-mind-of-a-monster/ted-bundy-mind-of-a-monsterzEhttps://www.discoveryplus.no/videoer/i-kongens-klr/sesong-1-episode-7zdhttps://www.discoveryplus.it/videos/biografie-imbarazzanti/luigi-di-maio-la-psicosi-di-stanislawskijzLhttps://www.discoveryplus.es/videos/la-fiebre-del-oro/temporada-8-episodio-1zPhttps://www.discoveryplus.fi/videot/shifting-gears-with-aaron-kaufman/episode-16c                 z   |                      |          }|                    d          }t          |                    d          d          }|                    d          p)|                    d          p|                    d          }|d         dk    rd	|z   nd
}|                     |||d|z   ||          S )NrS   r   zwww.r   subdomain_countryplus_countryr   dz
disco-api.zeu2-prod.disco-api.comdplay)_match_valid_urlgroupr   r   )r"   rC   mobjr$   r   r   hosts          r'   _real_extractzDPlayIE._real_extract9  s    $$S))ZZ%%
djj22F;;**Y''h4::6I+J+JhdjjYgNhNh(.q	S(8(8|f$$>V''T7W#4gvG G 	Gr)   N)r   r   r   r   r   
_VALID_URL_TESTSr   r   r)   r'   r   r      sH       	 !,	-J Es7A #% D
 
 T
# , eS3A #%54
 
 T
# , O< A#%'
 
 T
 .' * l1\AA2%#."
 
 $ UD!A0%#)"
 
 T
! ( Z  <  M  n  W  v  ^  b kxFtG G G G Gr)   r   c                   (    e Zd ZdZdZd Zd Zd ZdS )DiscoveryPlusBaseIEz/Subclasses must set _PRODUCT, _DISCO_API_PARAMSz27.43.0c           	          |                     d| d| j         d| j         d| j         |                     |||          d           d S )Nrealm=,siteLookupKey=WEB:UNKNOWN::x-disco-paramsx-disco-clientr=   update_PRODUCT_DISCO_CLIENT_VERr(   r>   s        r'   r@   z-DiscoveryPlusBaseIE._update_disco_api_headersH  sl    LuLLT]LLUT]UUT=SUU!^^J
EJJ
 
 	 	 	 	 	r)   c                     |                      |dz   ||t          j        ddd|i d                                                    d         d         d         S )	Nzplayback/v3/videoPlaybackInfoF)	adBlockerdrmSupported)
deviceInfovideoIdwisteriaProperties)r?   r   r   r   rB   )r!   jsondumpsencode)r"   r#   rG   r?   s       r'   rK   z1DiscoveryPlusBaseIE._download_video_playback_infoO  s    ""88gDJ!&$)  $&(8 8 - - vxx # 	 	  	! ".	/ 0;	< 		<r)   c                 P     | j         ||                     |          fi | j        S )N)r   	_match_id_DISCO_API_PARAMS)r"   rC   s     r'   r   z!DiscoveryPlusBaseIE._real_extract[  s.    't'T^^C-@-@[[DDZ[[[r)   N)r   r   r   __doc__r   r@   rK   r   r   r)   r'   r   r   C  sR        99!  
< 
< 
<\ \ \ \ \r)   r   c                       e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg dd d!gZd"Zd#d"d$d%Zd& Z	d'S )(HGTVDeIEz https?://de\.hgtv\.com/sendungenzNhttps://de.hgtv.com/sendungen/mein-kleinstadt-traumhaus/vom-landleben-ins-loftrS   7332936r   rZ   r$   z0mein-kleinstadt-traumhaus/vom-landleben-ins-loftrl   zVom Landleben ins Loftrf   z$md5:e5f72c02c853970796dd3818f2e25745r   r   rq   r   seasonSeason 7rp   ro   zMein Kleinstadt-Traumhausrm   g     @rn   ifr   20240910creatorsHGTVrs   r   zZhttps://eu1-prod-images.disco-api.com/2024/08/09/82a386b9-c688-32c7-b9ff-0b13865f0bae.jpegrC   r   hgtveu1-prod.disco-api.comder   r   r   c           	      h    |                     d| d|                     |||          d           d S Nr   zAlps:HyogaPlayer:0.0.0r   r   r(   r>   s        r'   r@   z"HGTVDeIE._update_disco_api_headers~  M    .u..6!^^J
EJJ
 
 	 	 	 	 	r)   N
r   r   r   r   r   r   r   r   r   r@   r   r)   r'   r   r   _  s)       4{7NNJ_
)
5
 L
 -	

 A
 {
 a
 j
 Q
 1
 
 
 :
 
 B
  u!
  F, H.     r)   r   c            
           e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddddddddg ddgdd d!d"d#d$dd%d&d'dd(d)d*d+d,d-gZd.Zd/d0d1d2Zd3S )4GoDiscoveryIEz&https?://(?:go\.)?discovery\.com/videoz]https://go.discovery.com/video/in-the-eye-of-the-storm-discovery-atve-us/trapped-in-a-twisterrS   5352642r$   z>in-the-eye-of-the-storm-discovery-atve-us/trapped-in-a-twisterr   rZ   rl   zTrapped in a Twisterrf   zJTwisters destroy Midwest towns, trapping spotters in the eye of the storm.rq   r   r   r   rp   r   Season 1ro   zIn The Eye Of The Stormrm   gNbXyt@r   20240715rn   ifrs   r   	Discoveryr   zZhttps://us1-prod-images.disco-api.com/2024/07/10/5e39637d-cabf-3ab3-8e9a-f4e9d37bc036.jpegr   zPhttps://go.discovery.com/video/dirty-jobs-discovery-atve-us/rodbuster-galvanizer4164906z1dirty-jobs-discovery-atve-us/rodbuster-galvanizerzRodbuster / GalvanizerzHMike installs rebar with a team of rodbusters, then he galvanizes steel.	   rS   r$   r   rl   rf   rp   rq   r   rC   r   r   zMhttps://discovery.com/video/dirty-jobs-discovery-atve-us/rodbuster-galvanizerTr   dscz us1-prod-direct.go.discovery.comgousr   N	r   r   r   r   r   r   r   r   r   r   r)   r'   r   r     s_       :[=TTJn
)
Z
 5
 +	

 g
 a
 {
 Q
 j
 /
 
 :
 
 B
 
  u!
 * bM-e
 
 .  _ A#FJ H8 r)   r   c            
           e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddddddddg ddgd d!d"d#d$d%dd&d'd(d)d*d+d,d#d-d.gZd/Zd0d1d2d3Zd4S )5TravelChannelIEz-https?://(?:watch\.)?travelchannel\.com/videozXhttps://watch.travelchannel.com/video/the-dead-files-travel-channel/protect-the-childrenrS   4710177r$   z2the-dead-files-travel-channel/protect-the-childrenr   rZ   rl   zProtect the Childrenrf   zAAn evil presence threatens an Ohio woman's children and marriage.rp      r   z	Season 14rq   
   r   z
Episode 10ro   zThe Dead Filesrm   gʡE@rn   ii6cr   20220930rs   r   zTravel Channelr   zZhttps://us1-prod-images.disco-api.com/2022/03/17/5e45eace-de5d-343a-9293-f400a2aa77d5.jpegr   zXhttps://watch.travelchannel.com/video/ghost-adventures-travel-channel/ghost-train-of-ely2220256z2ghost-adventures-travel-channel/ghost-train-of-elyzGhost Train of ElyzFThe crew investigates the dark history of the Nevada Northern Railway.   r   r   r   r   Tr   travz'us1-prod-direct.watch.travelchannel.comr   r   r   Nr   r   r)   r'   r   r     sa       AKD[[Ji
)
N
 5
 +	

 _
 R
 k
 b
 |
 &
 
 
 :
 B
 )*
  u!
 * jN)c
 
 .  j A#FJ H? r)   r   c            
           e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddddddddg ddgd d!d"d#d$d%dd&d'd(dd)d*d+d#d,d-gZd.Zd/d0d1d2Zd3S )4CookingChannelIEz0https?://(?:watch\.)?cookingchanneltv\.com/videoznhttps://watch.cookingchanneltv.com/video/bobbys-triple-threat-food-network-atve-us/titans-vs-marcus-samuelssonrS   5350005r   rZ   r$   zEbobbys-triple-threat-food-network-atve-us/titans-vs-marcus-samuelssonrl   zTitans vs Marcus Samuelssonrf   zCMarcus Samuelsson throws his legendary global tricks at the Titans.rq   r   r   r   rp      r   zSeason 3ro   zBobby's Triple Threatrm   gˡE@r   20240710rn   iݍfrs   r   Food Networkr   zZhttps://us1-prod-images.disco-api.com/2024/07/04/529cd095-27ec-35c5-84e9-90ebd3e5d2da.jpegr   zmhttps://watch.cookingchanneltv.com/video/carnival-eats-cooking-channel/the-postman-always-brings-rice-23486342348634zDcarnival-eats-cooking-channel/the-postman-always-brings-rice-2348634zThe Postman Always Brings RicezFNoah visits the Maui Fair and the Aurora Winter Festival in Vancouver.r   r   r   r   Tr   cookz*us1-prod-direct.watch.cookingchanneltv.comr   r   r   Nr   r   r)   r'   r  r    s`       D{G^^J
)
5
 a
 2	

 `
 a
 {
 Q
 j
 .
 
 :
 
 B
 (
  u!
 * `5c
 
 .   A#FJ HB r)   r  c                   |    e Zd Zdej        z   Zddddddddd	d
g dgdddddddddddddddddgZdZddddZdS ) 	HGTVUsaIEz$https?://(?:watch\.)?hgtv\.com/videozahttps://watch.hgtv.com/video/flip-or-flop-the-final-flip-hgtv-atve-us/flip-or-flop-the-final-flip5025585zDflip-or-flop-the-final-flip-hgtv-atve-us/flip-or-flop-the-final-fliprZ   zFlip or Flop: The Final FlipzFTarek and Christina are going their separate ways after one last flip!g?5^I)@20231101i@Aer   zZhttps://us1-prod-images.disco-api.com/2022/11/27/455caa6c-1462-3f14-b63d-a026d7a5e6d3.jpeg)rS   r$   r   rl   rf   ro   rm   r   rn   rs   r   r   r   zLhttps://watch.hgtv.com/video/home-inspector-joe-hgtv-atve-us/this-mold-house4289736z/home-inspector-joe-hgtv-atve-us/this-mold-housezThis Mold HousezGJoe and Noel help take a familys dream home from hazardous to fabulous.r   r   r   r   Tr   r   zus1-prod-direct.watch.hgtv.comr   r   r   Nr   r   r)   r'   r  r    s        8;;RRJr`3c4 %#u
 
 " ^K&d
 
 .  ^ 9FB H6 r)   r  c            
           e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddg ddgdddddddd d!d"d#d$dd%d&d'dd(d)d*d"d+d,gZd-Zd.d/d0d1Zd2S )3FoodNetworkIEz+https?://(?:watch\.)?foodnetwork\.com/videozVhttps://watch.foodnetwork.com/video/guys-grocery-games-food-network/wild-in-the-aislesrS   2152549r$   z2guys-grocery-games-food-network/wild-in-the-aislesr   rZ   rl   zWild in the Aislesrf   zGThe chefs make spaghetti and meatballs with "Out of Stock" ingredients.rp   r   r   r   rq   r   r   ro   zGuy's Grocery Gamesrs   r   r  rm   gd;OM@r   20230623rn   dr   zZhttps://us1-prod-images.disco-api.com/2022/06/15/37fb5333-cad2-3dbb-af7c-c20ec77c89c6.jpegr   z`https://watch.foodnetwork.com/video/kids-baking-championship-food-network/float-like-a-butterfly4116449z<kids-baking-championship-food-network/float-like-a-butterflyzFloat Like a Butterflyz9The 12 kid bakers create colorful carved butterfly cakes.r   r   r   r   Tr   foodz%us1-prod-direct.watch.foodnetwork.comr   r   r   Nr   r   r)   r'   r  r  >  s`       ?+BYYJg
)
N
 5
 )	

 d
 Q
 j
 a
 {
 ,
 B
 (
 
 :
 
  u!
 * rX-V
 
 .  r A#FJ H= r)   r  c            
           e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddg ddgddddddd d!d"d#d$d%dd&d'ddd(d)d*d#d+d,gZd-Zd.d/d0d1Zd2S )3DestinationAmericaIEz0https?://(?:www\.)?destinationamerica\.com/videoz\https://www.destinationamerica.com/video/bbq-pit-wars-destination-america/smoke-on-the-waterrS   2218409r$   z3bbq-pit-wars-destination-america/smoke-on-the-waterr   rZ   rl   zSmoke on the Waterrf   zGThe pitmasters head to Georgia for the Smoke on the Water BBQ Festival.rp   r   r   zSeason 2rq   r   r   r   ro   zBBQ Pit Warsrs   r   zDestination Americarm   gK7m@r   r  rn   r  r   zZhttps://us1-prod-images.disco-api.com/2020/05/11/c0f8e85d-9a10-3e6f-8e43-f6faafa81ba2.jpegr   zlhttps://www.destinationamerica.com/video/alaska-monsters-destination-america-atve-us/central-alaskas-bigfoot4210904zCalaska-monsters-destination-america-atve-us/central-alaskas-bigfootzCentral Alaskas BigfootzDA team heads to central Alaska to investigate an aggressive Bigfoot.r   r   r   Tr   damz&us1-prod-direct.destinationamerica.comr   r   r   Nr   r   r)   r'   r  r  m  s`       D{G^^Jm
)
O
 5
 )	

 d
 Q
 j
 a
 {
 n
 B
 ./
 
 :
 
  u!
 * ~_.a
 
 .  ~ A#FJ H> r)   r  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddgdg ddddddd d!d"d#d$d%dd&d'ddd(d)d*d#d+d,gZd-Zd.d/d0d1Zd2S )3InvestigationDiscoveryIEz4https?://(?:www\.)?investigationdiscovery\.com/videozhttps://www.investigationdiscovery.com/video/deadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-biancarS   5341132r$   zTdeadly-influence-the-social-media-murders-investigation-discovery-atve-us/rip-biancar   rZ   rl   z
RIP Biancarf   zJA teenage influencer discovers an online world of threat, harm and danger.rp   r   r   r   rq   r  r   z	Episode 3ro   z*Deadly Influence: The Social Media Murdersr   zInvestigation Discoveryrs   rm   gu@r   20240618rn   ipfr   zZhttps://us1-prod-images.disco-api.com/2024/06/15/b567c774-9e44-3c6c-b0ba-db860a73e812.jpegr   z^https://www.investigationdiscovery.com/video/unmasked-investigation-discovery/the-killer-clown2139409z1unmasked-investigation-discovery/the-killer-clownzThe Killer ClownzKA wealthy Florida woman is fatally shot in the face by a clown at her door.r   r   r   Tr   idsz*us1-prod-direct.investigationdiscovery.comr   r   r   Nr   r   r)   r'   r  r    sc       H;KbbJ S
)
p
 5
 \	

 g
 Q
 j
 a
 {
 B
 23
 B
 
 :
 
  u!
 * pM'h
 
 .  p A#FJ HB r)   r  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg dd d!d"d#d$dd%d&ddd'd(d)d"d*d+gZd,Zd-d.d/d0Zd1S )2AmHistoryChannelIEz#https?://(?:www\.)?ahctv\.com/videozThttps://www.ahctv.com/video/blood-and-fury-americas-civil-war-ahc/battle-of-bull-runrS   2139199r$   z8blood-and-fury-americas-civil-war-ahc/battle-of-bull-runr   rZ   rl   zBattle of Bull Runrf   zDTwo untested armies clash in the first real battle of the Civil War.rp   r   r   r   rq   r   r   ro   z#Blood and Fury: America's Civil Warrm   gT㥛i@r   20220923rn   i@/-cr   AHCrs   r   zZhttps://us1-prod-images.disco-api.com/2020/05/11/4af61bd7-d705-3108-82c4-1a6e541e20fa.jpegr   z2https://www.ahctv.com/video/modern-sniper-ahc/army2309730zmodern-sniper-ahc/armyArmyzISnipers today face challenges their predecessors couldve only dreamed of.r   r   r   Tr   ahczus1-prod-direct.ahctv.comr   r   r   Nr   r   r)   r'   r#  r#    s_       7+:QQJe
)
T
 5
 )	

 a
 Q
 j
 a
 {
 <
 
 :
 
 
 B
  u!
 * D2f
 
 .  D A#FJ H1 r)   r#  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg d d!d"d#d$d%dd&d'ddd(d)d*d#d+d,gZd-Zd.d/d0d1Zd2S )3ScienceChannelIEz,https?://(?:www\.)?sciencechannel\.com/videozghttps://www.sciencechannel.com/video/spaces-deepest-secrets-science-atve-us/mystery-of-the-dead-planetsrS   2347335r$   zBspaces-deepest-secrets-science-atve-us/mystery-of-the-dead-planetsr   rZ   rl   zMystery of the Dead Planetsrf   z>Astronomers unmask the truly destructive nature of the cosmos.rp   r   r   r   rq   r   r   r   ro   zSpace's Deepest Secretsrm   g}?5^@r   20230128rn   iЫcr   Sciencers   r   zZhttps://us1-prod-images.disco-api.com/2021/03/30/3796829d-aead-3f9a-bd8d-e49048b3cdca.jpegr   zZhttps://www.sciencechannel.com/video/strangest-things-science-atve-us/nazi-mystery-machine2842849z5strangest-things-science-atve-us/nazi-mystery-machinezNazi Mystery MachinezFExperts investigate the secrets of a revolutionary encryption machine.r   r   r   Tr   sciz"us1-prod-direct.sciencechannel.comr   r   r   Nr   r   r)   r'   r+  r+    s_       @;CZZJx
)
^
 5
 2	

 [
 Q
 j
 a
 {
 0
 
 :
 
 
 B
  u!
 * lQ+c
 
 .  l A#FJ H: r)   r+  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg dd d!d"d#d$dd%d&dd'd(d)d*d"d+d,gZd-Zd.d/d0d1Zd2S )3DiscoveryLifeIEz+https?://(?:www\.)?discoverylife\.com/videozQhttps://www.discoverylife.com/video/er-files-discovery-life-atve-us/sweet-charityrS   2347614r$   z-er-files-discovery-life-atve-us/sweet-charityr   rZ   rl   zSweet Charityrf   z=The staff at Charity Hospital treat a serious foot infection.rp   r   r   r   rq   r   r   ro   zER Filesrm   gʡx@r   20230721rn   idr   zDiscovery Lifers   r   zZhttps://us1-prod-images.disco-api.com/2021/03/16/4b6f0124-360b-3546-b6a4-5552db886b86.jpegr   zXhttps://www.discoverylife.com/video/surviving-death-discovery-life-atve-us/bodily-trauma2218238z4surviving-death-discovery-life-atve-us/bodily-traumazBodily Traumaz:Meet three people who tested the limits of the human body.r   r   r   r   Tr   dlfz!us1-prod-direct.discoverylife.comr   r   r   Nr   r   r)   r'   r2  r2  )  s_       ?+BYYJb
)
I
 5
 _	

 Z
 Q
 j
 a
 {
 j
 
 :
 
 )*
 B
  u!
 * jP$W
 
 .  j A#FJ H9 r)   r2  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg d d!d"d#d$d%dd&d'd(d)d*d+d,d#d-d.gZd/Zd0d1d2d3Zd4S )5AnimalPlanetIEz*https?://(?:www\.)?animalplanet\.com/videozthttps://www.animalplanet.com/video/mysterious-creatures-with-forrest-galante-animal-planet-atve-us/the-demon-of-perurS   4650835r$   zQmysterious-creatures-with-forrest-galante-animal-planet-atve-us/the-demon-of-perur   rZ   rl   zThe Demon of Perurf   uI   In Peru, a farming village is being terrorized by a “man-like beast.”rp   r   r   r   rq      r   z	Episode 4ro   z)Mysterious Creatures with Forrest Galanterm   g"t@r   20230111rn   iPBcr   zAnimal Planetrs   r   zZhttps://us1-prod-images.disco-api.com/2022/03/01/6dbaa833-9a2e-3fee-9381-c19eddf67c0c.jpegr   zRhttps://www.animalplanet.com/video/north-woods-law-animal-planet/squirrel-showdown3338923z/north-woods-law-animal-planet/squirrel-showdownzSquirrel ShowdownzDA woman is suspected of being in possession of flying squirrel kits.      r   r   r   Tr   aplz us1-prod-direct.animalplanet.comr   r   r   Nr   r   r)   r'   r8  r8  X  sc       >AXXJ F
)
m
 5
 (	

 f
 Q
 j
 a
 {
 A
 
 :
 
 )
 B
  u!
 * dK(a 
 
 .  d A#FJ H8 r)   r8  c            
           e Zd Zdej        z   Zdi ddddddd	d
ddddddddddddddddddddgdg dd d!d"d#d$dd%d&ddd'd(d)d"d*d+gZd,Zd-d.d/d0Zd1S )2TLCIEz https?://(?:go\.)?tlc\.com/videozKhttps://go.tlc.com/video/90-day-the-last-resort-tlc-atve-us/the-last-chancerS   5186422r$   z290-day-the-last-resort-tlc-atve-us/the-last-chancer   rZ   rl   zThe Last Chancerf   zJInfidelity shakes Kalani and Asuelu's world, and Angela threatens divorce.rp   r   r   r   rq   r   r   ro   z90 Day: The Last Resortrm   g\@r   20230815rn   idr   TLCrs   r   zZhttps://us1-prod-images.disco-api.com/2023/08/08/0ee367e2-ac76-334d-bf23-dbf796696a24.jpegr   zAhttps://go.tlc.com/video/my-600-lb-life-tlc/melissas-story-part-12206540z(my-600-lb-life-tlc/melissas-story-part-1zMelissas Story (Part 1)zIAt 650 lbs, Melissa is ready to begin her seven-year weight loss journey.r   r   r   Tr   tlczus1-prod-direct.tlc.comr   r   r   Nr   r   r)   r'   rA  rA    s_       4{7NNJ\
)
N
 5
 &	

 h
 Q
 j
 a
 {
 /
 
 :
 
 
 B
  u!
 * SD.f
 
 .  S A#FJ H/ r)   rA  c                   v    e Zd Zdej        z   Zdddddddd	d
ddddddddddddddddgZdZdZd Z	d Z
dS )DiscoveryPlusIEzbhttps?://(?:www\.)?discoveryplus\.com/(?!it/)(?:(?P<country>[a-z]{2})/)?video(?:/sport|/olympics)?zRhttps://www.discoveryplus.com/video/property-brothers-forever-home/food-and-family1140794z.property-brothers-forever-home/food-and-familyrZ   zFood and FamilyzCThe brothers help a Richmond family expand their single-level home.g"9.@iP	_20201230r   zProperty Brothers: Forever Homer   r   r   r   zLhttps://discoveryplus.com/ca/video/bering-sea-gold-discovery-ca/goldslingersTr   zphttps://www.discoveryplus.com/gb/video/sport/eurosport-1-british-eurosport-1-british-sport/6-hours-of-spa-reviewzjhttps://www.discoveryplus.com/gb/video/olympics/dplus-sport-dplus-sport-sport/rugby-sevens-australia-samoaNc           	          |                     d| d| j         d| j         |                     |||          d           d S Nr   r   zWEB:UNKNOWN:dplus_us:r   r   r>   s        r'   r@   z)DiscoveryPlusIE._update_disco_api_headers  b    LuLLT]LLNd6LNN!^^J
EJJ
 
 	 	 	 	 	r)   c                     |                      |                              dd          \  }}|sd}d| | _        |dv rdd|d| _        nd	d
|d| _         | j        ||fi | j        S )NrS   r   r   dplus_)brcar   z!us1-prod-direct.discoveryplus.comr   r   !eu1-prod-direct.discoveryplus.comr   )r   r   r   r   r   )r"   rC   rG   r   s       r'   r   zDiscoveryPlusIE._real_extract  s     11#66<<T9MM' 	G***(((A"& &D"" B "& &D" (t'XPP9OPPPr)   )r   r   r   r   r   r   r   r   r   r@   r   r   r)   r'   rH  rH    s        v  zE  zQ  QJcJ&` #%7
 
 .! $ ^  B  | /F8 H  Q Q Q Q Qr)   rH  c                       e Zd Zdej        z   Zdi ddddddd	d
dddddddddddddddddddddd d!g d"d#id$gZd%Zd&d'd(d)d*Zd+ Z	d,S )-DiscoveryPlusIndiaIEz,https?://(?:www\.)?discoveryplus\.in/videos?z[https://www.discoveryplus.in/videos/how-do-they-do-it/fugu-and-more?seasonId=8&type=EPISODErS   27104r   rZ   r$   zhow-do-they-do-it/fugu-and-morerl   zFugu and Morerf   zEThe Japanese catch, prepare and eat the deadliest fish on the planet.rm   gzG@rn   i!P^r   20200221ro   zHow Do They Do It?rp   r   rq   r   rr   zDiscovery Channelr   zre:https://.+\.jpegr   z	Episode 2r   zSeason 8rs   r   Tr   zdplus-indiaz ap2-prod-direct.discoveryplus.in
dplusindiainhttps://www.discoveryplus.in/)r   r   r   r   c           	      z    |                     d| d| j         d|                     |||          d           d S )Nr   r   z:17.0.0r   )r   r   r(   r>   s        r'   r@   z.DiscoveryPlusIndiaIE._update_disco_api_headers  sZ    .u..CT]CCC!^^J
EJJ
 
 	 	 	 	 	r)   Nr   r   r)   r'   rT  rT    s6       @;CZZJl
'
5
 ;
 _	

 b
 
 
 :
 *
 Q
 a
 *
 /
 {
 j
  B!
& T
)  F2 H81	     r)   rT  c                      e Zd ZdZdi ddddddd	d
ddddddddddddddddddddgdd d!g d"d#d$d%gd&d'id(d)i dd*dddd+d	d,dd-dd.d/d0dd1dd2ddd!g d3dd4dddd5dddd6d7d8d9d:d;d<d:d;d=i dd>dddd?d	d@ddAdddddd1ddddBddCddDddEddgddFd!g d#g dGd&d'id(dHi ddIddddJd	dKddLddddddMddNddOddPddQddRdd0gddSd!g d#dTdUgd&d'id(dVi ddWddddXd	dYddZdddddd1dddd[dd\dd]dd^dd0gdd_d!d`d#dadbgd&d'id(gZdc Zdd ZdeS )fDiscoveryNetworksDeIEzhttps?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de)/(?:programme|show|sendungen)/(?P<programme>[^/?#]+)/(?:video/)?(?P<alternate_id>[^/?#]+)z>https://dmax.de/sendungen/goldrausch-in-australien/german-goldrS   4756322r   rZ   rl   zGerman Goldrf   z$md5:f3073306553a8d9b40e6ac4cdbf09fc6r$   z$goldrausch-in-australien/german-goldr   r   rq   r   r   zSeason 5rp      ro   zGoldrausch in Australienrm   g     @r   20230517rn   i|Aedr   DMAXr   zZhttps://eu1-prod-images.disco-api.com/2023/05/09/f72fb510-7992-3b12-af7f-f16a2c22d1e3.jpegrs   )schatzsucherschatznuggetu   bodenschätzez
down under
australien
goldrausch
categoriesGoldSchatzsucherr   rY   r   zThttps://www.tlc.de/programme/breaking-amish/video/die-welt-da-drauen/DCB33127000110078867u   Die Welt da draußenz$md5:61033c12b73286e409d99a41742ef608i`8\20190331rr   rD  r   zBreaking Amish)znew yorku
   großstadtamische	landlebenmoderninfos	traditionherausforderungz!breaking-amish/die-welt-da-draueng5^I@zre:https://.+\.jpgz404 Not Foundr   zqhttps://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316Tr   z;https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/zXhttps://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-38873549z24 Stunden auf der Feuerwache 3z$md5:f3084ef6170bfb79f9a6e0c030e09330z>feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3u    Feuerwache 3 - Alarm in Müncheng     @20251016iOhzZhttps://eu1-prod-images.disco-api.com/2025/10/14/0bdee68c-a8d8-33d9-9204-16eb61108552.jpeg)zDMAX OriginalsJobs	BlaulichtzHhttps://tlc.de/sendungen/ghost-adventures/der-poltergeist-im-kostumladen4550602u   Der Poltergeist im Kostümladenz$md5:20b52b9736a0a3a7873d19a238fad7fcz/ghost-adventures/der-poltergeist-im-kostumladenz	Season 25   zGhost Adventuresg     z@20241223i$8igzZhttps://eu1-prod-images.disco-api.com/2023/04/05/59941d26-a81b-365f-829f-69d8cd81fd0f.jpeg
Paranormalz	Gruselig!zOhttps://tlc.de/sendungen/evil-gesichter-des-boesen/das-geheimnis-meines-bruders7792288zDas Geheimnis meines Brudersz$md5:3167550bb582eb9c92875c86a0a20882z6evil-gesichter-des-boesen/das-geheimnis-meines-brudersu   Evil - Gesichter des Böseng     @20240926i`fzZhttps://eu1-prod-images.disco-api.com/2024/11/29/e9f3e3ae-74ec-3631-81b7-fc7bbe844741.jpegzcount:13z
True CrimeMordc           
         |                      |                                          \  }}}| d| }|                     d| d||                    d          d         d|dd          }t	          |d	t
          hd
 hf          p|}|                     ||d|                    dd          d          }||d<   t	          |dd dt
          j        ht          t          t          f          |d<   |S )NrO   z*https://de-api.loma-cms.com/feloma/videos/.r   2)environmentvzfilter[show.slug]F)r   rW   uidc                     | dd          S )Nir   )ss    r'   <lambda>z5DiscoveryNetworksDeIE._real_extract.<locals>.<lambda>  s    "## r)   r   rL   DEr$   
taxonomiesc                     |d         dk    S )Ncategorygenrer   )_r  s     r'   r  z5DiscoveryNetworksDeIE._real_extract.<locals>.<lambda>  s    q}'? r)   rl   rf  )r   groupsr!   splitr   strr   replacer}   filterall)	r"   rC   r   	programmealternate_idr$   metarG   disco_api_infos	            r'   r   z#DiscoveryNetworksDeIE._real_extract  s0   *.*?*?*D*D*K*K*M*M'	<!22L22
""HHHH%||C003%.   #    use6F6F5G&HIIWZ113V^^C5L5LdT T'1|$'3D??39+W]_bdj;l (m (m|$ r)   c           	      h    |                     d| d|                     |||          d           d S r   r   r>   s        r'   r@   z/DiscoveryNetworksDeIE._update_disco_api_headers  r   r)   N)r   r   r   r   r   r   r@   r   r)   r'   r\  r\     s         ]J P
)
5
 ]
 A	

 @
 {
 a
 j
 Q
 0
 
 :
 
 
 u
  sss!
" 6>2#
& #F++ . f
'
5
 +
 A	

 
 :
 u
 j
 &
 a
 yyy
 =
 {
 
 Q
  .!
$  ) , C  M  j
)
5
 6
 A	

 Z
 {
 a
 j
 Q
 8
 
 :
 
 
 u
  B!
" AAA#
& #F++ . Z
)
5
 6
 A	

 K
 {
 a
 k
 R
 (
 
 :
 
 
 u
  B!
" <5#
& #F++ . a
)
5
 3
 A	

 R
 {
 a
 j
 Q
 3
 
 :
 
 
 u
  J!
" <0#
& #F++ {sFj  (    r)   r\  c                       e Zd Zd Zd ZdS )DiscoveryPlusShowBaseIEc              #     K   | j         d| j         | j        |                     | j        d | j                  d}|                     | j         d| j         d| d||          d         | j                 d         d	         }|d
                             d          d         }| j        dz   }|d         d         d         D ]}|d         }d\  }}	|	|k     r|                     |	                    ||t          |	dz                       ||d	                    ||	rd|	 nd                    }
|	dk    rt          |
d t                    pd}|
d         }|D ]`}|d         d         }|                     | j         d| | j                                        |                    d          p|          V  a|	dz  }	|	|k     d S )Nr   )r   r   rk   Authenticationzcms/routes/rO   z?include=default)rG   r?   r^   r   	componentmandatoryParams=zkcontent/videos?sort=episodeNumber&filter[seasonNumber]={}&filter[show.id]={}&page[size]=100&page[number]={}filtersr   optionsrS   )r   r   r   z%Downloading season {} JSON metadata{}z page rL   )r?   notec                     | d         d         S )Nr  
totalPagesr   )xs    r'   r  z2DiscoveryPlusShowBaseIE._entries.<locals>.<lambda>  s    6<AX r)   r   pathzvideos/)ierG   )	_X_CLIENT_REALM_DOMAINr(   	_BASE_APIr!   	_SHOW_STR_INDEXr  formatr  r   int
url_result	_VIDEO_IEie_keyr   )r"   	show_namer?   	show_jsonshow_id
season_urlr   	season_idtotal_pagespage_numseason_jsonepisodes_jsonr   
video_paths                 r'   _entriesz DiscoveryPlusShowBaseIE._entries  s\     "n4t{44|"nnT^T4;OO	
 
 ''~VV$.VV9VVV ( 1 11;==A[JJVXXce	 -.44S99"=^  'T  T
	*1-i8 	 	FtI$(!K[(("11%%i#hl:K:KLLiah@GG	jrSzSf\dSfSfSfxz{{ 2 } } q==")+7X7XZ]"^"^"cbcK +F 3, ^ ^G!(!6v!>J//<<<
<<>0022W[[=N=N=\R\ * ^ ^ ^ ^ ^ ^ A [((	 	r)   c                     |                      |                              d          }|                     |                     |          |          S )Nr  )playlist_id)r   r   playlist_resultr  )r"   rC   r  s      r'   r   z%DiscoveryPlusShowBaseIE._real_extract  sH    ))#..44[AA	##DMM)$<$<)#TTTr)   N)r   r   r   r  r   r   r)   r'   r  r    s7          :U U U U Ur)   r  c                   \    e Zd Zdej        z   ZddddddddddddgZdZd	d
ddZd Z	dS )DiscoveryPlusItalyIEzChttps?://(?:www\.)?discoveryplus\.com/it/video(?:/sport|/olympics)?z_https://www.discoveryplus.com/it/video/i-signori-della-neve/stagione-2-episodio-1-i-preparativiTr   z:https://www.discoveryplus.com/it/video/super-benny/trailerzehttps://www.discoveryplus.com/it/video/olympics/dplus-sport-dplus-sport-sport/water-polo-greece-italyzmhttps://www.discoveryplus.com/it/video/sport/dplus-sport-dplus-sport-sport/lisa-vittozzi-allinferno-e-ritornodplus_itrR  r   itr   c           	          |                     d| d| j         d| j         |                     |||          d           d S rL  r   r>   s        r'   r@   z.DiscoveryPlusItalyIE._update_disco_api_headers  rM  r)   Nr   r   r)   r'   r  r    s        WZeZqqJp  L  w   F H9     r)   r  c                   @    e Zd ZdZddddidgZdZdZd	Zd
ZdZ	dZ
eZdS )DiscoveryPlusItalyShowIEzOhttps?://(?:www\.)?discoveryplus\.it/programmi/(?P<show_name>[^/]+)/?(?:[?#]|$)zAhttps://www.discoveryplus.it/programmi/deal-with-it-stai-al-gioco   rS   zdeal-with-it-stai-al-giocorC   playlist_mincountr   z#https://disco-api.discoveryplus.it/zhttps://www.discoveryplus.it/zWEB:UNKNOWN:dplay-client:2.6.0dplayit	programmir   N)r   r   r   r   r   r  r  r  r  r  r  r   r  r   r)   r'   r  r    sZ        cJR .
  F 6I-G0IFIFIIIr)   r  c                   @    e Zd ZdZddddidgZdZdZd	Zd
ZdZ	dZ
eZdS )DiscoveryPlusIndiaShowIEzJhttps?://(?:www\.)?discoveryplus\.in/show/(?P<show_name>[^/]+)/?(?:[?#]|$)z3https://www.discoveryplus.in/show/how-do-they-do-it   rS   zhow-do-they-do-itr  z)https://ap2-prod-direct.discoveryplus.in/rY  zWEB:UNKNOWN:dplus-india:prodrW  rd   r:  N)r   r   r   r   r   r  r  r  r  r  r  rT  r  r   r)   r'   r  r  
  sZ        ^JD %
  F <I-G.IFIF$IIIr)   r  )(r   r   commonr   networking.exceptionsr   utilsr   r   r	   r
   r   r   r   r   utils.traversalr   r   r   r   r   r   r   r  r  r  r  r  r#  r+  r2  r8  rA  rH  rT  r\  r  r  r  r  r   r)   r'   <module>r     s     ! ! ! ! ! ! - - - - - -	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 + * * * * *]
 ]
 ]
 ]
 ]
- ]
 ]
 ]
@MG MG MG MG MGk MG MG MG`\ \ \ \ \+ \ \ \8$ $ $ $ $" $ $ $N, , , , ,' , , ,^, , , , ,) , , ,^, , , , ,* , , ,^( ( ( ( (# ( ( (V, , , , ,' , , ,^, , , , ,. , , ,^, , , , ,2 , , ,^, , , , ,, , , ,^, , , , ,* , , ,^, , , , ,) , , ,^, , , , ,( , , ,^, , , , , , , ,^<Q <Q <Q <Q <Q) <Q <Q <Q~( ( ( ( (. ( ( (VQ Q Q Q Q/ Q Q Qh!U !U !U !U !Uk !U !U !UH    .   >    6   &% % % % %6 % % % % %r)   