o
    iA                     @   sT   d dl mZ d dlmZ ddlmZmZmZmZ ddl	m
Z
mZ G dd deZdS )	   )InfoExtractor)	YoutubeIE   )
clean_htmlparse_iso8601
update_urlurl_or_none)subs_list_to_dicttraverse_objc                   @   sh   e Zd ZdZdZdZdddddd	gd
dddddddddddddgddddddddgZdd ZdS )
StarTrekIEstartrekz	STAR TREKzIhttps?://(?:www\.)?startrek\.com(?:/en-(?:ca|un))?/videos/(?P<id>[^/?#]+)zUhttps://www.startrek.com/en-un/videos/official-trailer-star-trek-lower-decks-season-4z/official-trailer-star-trek-lower-decks-season-4mp4z4Official Trailer | Star Trek: Lower Decks - Season 4z$md5:dd7e3191aaaf9e95db16fc3abd5ef68bTRAILERSz$md5:563d7856ddab99bee7a5e50f4553175720230722i0ܻdzStar Trek: Lower Deckszstar-trek-lower-deckszre:https?://.+\.(?:jpg|png))idexttitle	alt_title
categoriesdescriptionrelease_daterelease_timestampseries	series_id	thumbnail)url	info_dictzJhttps://www.startrek.com/en-ca/videos/my-first-contact-senator-cory-bookerz$my-first-contact-senator-cory-bookerz%My First Contact: Senator Cory Bookerz$md5:fe74a8bdb0afab421c6e159a7680db4dzMY FIRST CONTACTz$md5:a3992ab3b3e0395925d71156bbc018ce20250401iPgzStar Trek: The Original Serieszstar-trek-the-original-seriesc                    s  |  |}| ||}| ||d d }|d d }|d }r(| |tS t|dddd	thtf |t|d
ddddd fdddthtf
 dt|dddt	htfdddt	htfdddtj
httfddddddt	htfdthfddittddhfddthtd d hfd!thfd"S )#Nprops	pagePropsvideodatayoutube_video_idseries_and_movies.series_or_movieslugqueriedheadertab3slicesitemsc                    s   |d d  kS )Nlinkr%    )_vr   r,   M/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/startrek.py<lambda>@   s    z*StarTrekIE._real_extract.<locals>.<lambda>	link_copy)r   r   r   r   textsubheadcategorycategory_nameprimarycontent	publishedr   legacy_subtitle_fileen)langposter_frame)querylegacy_video_url)r   r   r   r   r   	subtitlesr   r   )	_match_id_download_webpage_search_nextjs_dataget
url_resultr   r
   stranyr   upperfilterallr   r	   r   r   )selfr   video_idwebpage
page_props
video_data
youtube_idr,   r/   r0   _real_extract0   s6   
zStarTrekIE._real_extractN)__name__
__module____qualname__IE_NAMEIE_DESC
_VALID_URL_TESTSrQ   r,   r,   r,   r0   r      sD     r   N)commonr   youtuber   utilsr   r   r   r   utils.traversalr	   r
   r   r,   r,   r,   r0   <module>   s
    