o
    ir	                     @   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traverse_objunified_timestampurl_or_nonec                	   @   sF   e Zd ZdZdddddddd	d
ddidgZdZddiZdd ZdS )ClipchampIEz6https?://(?:www\.)?clipchamp\.com/watch/(?P<id>[\w-]+)z'https://clipchamp.com/watch/gRXZ4ZhdDaUgRXZ4ZhdDaUmp4zUntitled videozAlexander Schwartzi/d20230406zre:^https?://.+\.jpg)idexttitleuploader	timestampupload_date	thumbnailskip_downloadm3u8)url	info_dictparamsz4https://%s.cloudflarestream.com/%s/manifest/video.%sparentOriginzhttps://clipchamp.comc           
   
   C   s  |  |}| ||}| ||d d d }|d}|dkr(td| d|d }| d	| |d
}| jd|dddp@d}| j| j||df || jddd}	|		| j
| j||df |d| jddd ||	dt|ddthfpvd dt|ddthfdthfdthfdS ) Nprops	pagePropsvideostorage_location	cf_streamz#Unsupported clip storage location ""download_urlz$https://iframe.cloudflarestream.com/zDownloading player iframez+\bcustomer-domain-prefix=["\']([\w-]+)["\']	subdomainF)fatalzcustomer-2ut9yn3y6fta1yxempddash)queryr!   mpd_idr   r
   hls)r$   r!   m3u8_id creator)
first_name	last_name)r   formatsr   projectproject_name
created_atthumbnail_url)r   r   r   )	_match_id_download_webpage_search_nextjs_datagetr   _search_regex_extract_mpd_formats_STREAM_URL_TMPL_STREAM_URL_QUERYextend_extract_m3u8_formatsjoinr   strr   r   )
selfr   video_idwebpagedatar   pathiframer    r,    rC   N/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/clipchamp.py_real_extract   sD   


zClipchampIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSr7   r8   rE   rC   rC   rC   rD   r   
   s     	r   N)commonr   utilsr   r   r   r   r   rC   rC   rC   rD   <module>   s    