o
    im                     @   sD   d dl mZ ddlmZmZmZmZ ddlmZ G dd deZ	dS )   )InfoExtractor   )ExtractorErrordetermine_extparse_iso8601url_or_none)traverse_objc                   @   s   e Zd Zd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dddddi ddddddd d!d"d#d$d%d&d'd(d)d*ed+d,d-d.d/d0gd1d2d3ed4d5d6d2d7d8d9dd:ed5g d;ed<dgZd=d> Zd?S )@
TrtWorldIEz;https?://www\.trtworld\.com/video/[\w-]+/[\w-]+-(?P<id>\d+)zThttps://www.trtworld.com/video/news/turkiye-switches-to-sustainable-tourism-1606769016067690mp4u(   Türkiye switches to sustainable tourismiGke20231202z@https://cdn-i.pr.trt.com.tr/trtworld/17647563_0-0-1920-1080.jpegz$md5:0a975c04257fb529c8f99c7b76a2cf12)idexttitlerelease_timestamprelease_date	thumbnaildescription)url	info_dictz}https://www.trtworld.com/video/one-offs/frames-from-anatolia-recreating-a-james-bond-scene-in-istanbuls-grand-bazaar-1454178014541780uV   Frames From Anatolia: Recreating a ‘James Bond’ Scene in Istanbul’s Grand Bazaarid20230819z@https://cdn-i.pr.trt.com.tr/trtworld/16939810_0-0-1920-1080.jpegz$md5:4050e21570cc3c40b6c9badae800a94fzqhttps://www.trtworld.com/video/the-newsmakers/can-sudan-find-peace-amidst-failed-transition-to-democracy-1290476012904760z;Can Sudan find peace amidst failed transition to democracy?i@d20230420zNhttp://cdni0.trtworld.com/w768/q70/154214_NMYOUTUBETEMPLATE1_1681833018736.jpg)r   r   r   r   r   r   zvhttps://www.trtworld.com/video/africa-matters/locals-learning-to-cope-with-rising-tides-of-kenyas-great-lakes-16059545r   zEns2dWl00wr   r   z@Locals learning to cope with rising tides of Kenya's Great Lakesr   z4https://i.ytimg.com/vi/zEns2dWl00w/maxresdefault.jpgr   z$md5:3ad9d7c5234d752a4ead4340c79c6b8d
channel_idzUC7fWeaHhqgM4Ry-RMpM2YYwchannel_urlz8https://www.youtube.com/channel/UC7fWeaHhqgM4Ry-RMpM2YYwduration   
view_count	age_limit    webpage_urlz+https://www.youtube.com/watch?v=zEns2dWl00w
categorieszNews & Politicschannelz	TRT Worldchannel_follower_countchannel_is_verifiedTuploaderuploader_idz	@trtworldz!https://www.youtube.com/@trtworldpublicnot_live)uploader_urlupload_dateavailabilitycomment_countplayable_in_embedtagslive_status
like_countc              
   C   s   |  |}| ||}| ||d d d }g }t|dddthfD ]}t|dkr7|| j||dd	 q#|d
|d q#|sUt|d }rO| 	|dS t
ddd||dt|ddddthfdddthfdddthfddthfdfddS )N	videoDatacontent	platforms)websiteottmetadata)hls_urlr   m3u8F)fatalhttp)	format_idr   )youtuber8   	youtubeIdYoutubezNo video foundT)expected)r   formatsfieldsr   textr   r   r   	publisheddate)r   r   r   r   )get_all)	_match_id_download_webpage_search_nuxt_datar   r   r   extend_extract_m3u8_formatsappend
url_resultr   strr   )selfr   
display_idwebpagenuxtjs_datarB   	media_url
youtube_id rV   M/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/trtworld.py_real_extractH   s:   




zTrtWorldIE._real_extractN)__name__
__module____qualname__
_VALID_URLint_TESTSrX   rV   rV   rV   rW   r	      s    	
?r	   N)
commonr   utilsr   r   r   r   utils.traversalr   r	   rV   rV   rV   rW   <module>   s    