o
    i'                     @   s@   d dl mZ ddlmZmZmZ ddlmZ G dd deZdS )   )InfoExtractor   )parse_age_limitparse_durationurl_or_none)traverse_objc                
   @   s~   e Zd ZdZdddddddg d	d
ddiddddddddddgd
ddiddddg ddddddidgZdd ZdS )MagellanTVIEzAhttps?://(?:www\.)?magellantv\.com/(?:watch|video)/(?P<id>[\w-]+)z;https://www.magellantv.com/watch/incas-the-new-story?type=vzincas-the-new-storymp4zIncas: The New Storyz$md5:936c7f6d711c02dfb9db22a067b586fe   g     @)zAncient HistoryArchaeologyAnthropology)idexttitledescription	age_limitdurationtagsskip_downloadm3u8)url	info_dictparamszFhttps://www.magellantv.com/video/tortured-to-death-murdering-the-nannyz%tortured-to-death-murdering-the-nannyz&Tortured to Death: Murdering the Nannyz$md5:d87033594fa218af2b1a8b49f52511e5g     @z
True CrimeMurderz:https://www.magellantv.com/watch/celebration-nation?type=szcelebration-nation)zArt & CulturezHuman Interestr   ChinaHistory	Ancestors)r   r   r   r   r   c              
   C   s   |  |}| ||}| ||d d d }t|dthtf}g i }}tt|dthfD ]}| j||dddd	\}	}
|	|	 | j
|
|d
 q/|snt|ddthf }rnd|v ra| j|d | j| j d| dd |||dt|dthfddthfdthfdthfddthfdS )Nprops	pagePropsreactContext))videodetail)seriescurrentEpisode))	manifests.hlsjwp_video_urlr	   r%   F)m3u8_idfatal)targeterrorDetailPageerrorMessagezavailable in your country)msgz said: T)expected)r   formats	subtitlesr   metadatar   r   ratingCategoryr   .)r   r   r   r   r   )	_match_id_download_webpage_search_nextjs_datar   dictanysetr   #_extract_m3u8_formats_and_subtitlesextend_merge_subtitlesstrraise_geo_restrictedraise_no_formatsIE_NAMEr   r   )selfr   video_idwebpagecontextdatar.   r/   m3u8_urlfmtssubserror rH   O/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/magellantv.py_real_extract,   s6   






zMagellanTVIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSrJ   rH   rH   rH   rI   r      sF    		$r   N)	commonr   utilsr   r   r   utils.traversalr   r   rH   rH   rH   rI   <module>   s    