o
    i                     @   s8   d dl mZ ddlmZmZmZmZ G dd deZdS )   )InfoExtractor   )ExtractorError
clean_htmlint_or_nonetraverse_objc                   @   s|   e Zd 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ddddddg	Zdd ZdS )StarTVIEz(?x)
        https?://(?:www\.)?startv\.com\.tr/
        (?:
            (?:dizi|program)/(?:[^/?#&]+)/(?:bolumler|fragmanlar|ekstralar)|
            video/arsiv/(?:dizi|program)/(?:[^/?#&]+)
        )/
        (?P<id>[^/?#&]+)
    startvz5https://www.startv.com.tr/dizi/cocuk/bolumler/3-bolum 72381a32bcc2e2eb5841e8c8bf68f127904972z3-bolummp4u
   3. Bölümz$md5:3a8049f05a75c2e8747116a673275de4zre:^https?://.*\.jpg(?:\?.*?)?$ixU]20190923)id
display_idexttitledescription	thumbnail	timestampupload_date)urlmd5	info_dictz8https://www.startv.com.tr/video/arsiv/dizi/avlu/44-bolumT)r   only_matchingz@https://www.startv.com.tr/dizi/cocuk/fragmanlar/5-bolum-fragmanizRhttps://www.startv.com.tr/dizi/cocuk/ekstralar/5-bolumun-nefes-kesen-final-sahnesizFhttps://www.startv.com.tr/program/burcu-ile-haftasonu/bolumler/1-bolumzJhttps://www.startv.com.tr/program/burcu-ile-haftasonu/fragmanlar/2-fragmanzWhttps://www.startv.com.tr/video/arsiv/program/buyukrisk/14-bolumde-hangi-unlu-ne-sordu-zLhttps://www.startv.com.tr/video/arsiv/program/buyukrisk/buyuk-risk-334-bolumz@https://www.startv.com.tr/video/arsiv/program/dada/dada-58-bolumc              	   C   s   |  |}| ||}| jd|ddd}t| ||dtd}|s%tdt|d}|d	p5| 	|}t
|d
pC| j|d d}| j| |dd}	| jt|d|dddd}
|||||	t|d|
dS )Nz4(["\'])videoUrl\1\s*:\s*\1(?P<url>(?:(?!\1).)+)\1\s*zvideo info urlr   )groupdata)expected_typezFailed to extract API datar   r   r   )defaultzhttp:)scheme)flavorshlsm3u8_nativer    F)entry_protocolm3u8_idfatalrelease_date)r   r   r   r   r   r   formats)	_match_id_download_webpage_search_regexr   _download_jsondictr   strget_og_search_titler   _og_search_description_proto_relative_url_og_search_thumbnail_extract_m3u8_formatsr   )selfr   r   webpageinfo_urlinfovideo_idr   r   r   r&    r8   K/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/startv.py_real_extractE   s4   

zStarTVIE._real_extractN)__name__
__module____qualname__
_VALID_URLIE_NAME_TESTSr:   r8   r8   r8   r9   r   
   sR    1r   N)commonr   utilsr   r   r   r   r   r8   r8   r8   r9   <module>   s    