o
    i	                     @   s4   d dl mZ ddlmZmZmZ G dd deZdS )   )InfoExtractor   )ExtractorErrortraverse_objunified_strdatec                   @   sH   e Zd ZdZdZddddddd	d
ddddddd	d
gZdd ZdS )ProjectVeritasIEFzKhttps?://(?:www\.)?projectveritas\.com/(?P<type>news|video)/(?P<id>[^/?#]+)zphttps://www.projectveritas.com/news/exclusive-inside-the-new-york-and-new-jersey-hospitals-battling-coronavirus/z$51910aab-365a-5cf1-88f2-8eb1ca5fd3c6mp4zLExclusive: Inside The New York and New Jersey Hospitals Battling Coronavirus20200327z$md5:6076477fe50b03eb8708be9415e18e1c)idexttitleupload_date	thumbnail)url	info_dictzrhttps://www.projectveritas.com/video/ilhan-omar-connected-ballot-harvester-in-cash-for-ballots-scheme-car-is-full/z$c5aab304-a56b-54b1-9f0b-03b77bc5f2f6zcIlhan Omar connected Ballot Harvester in cash-for-ballots scheme: "Car is full" of absentee ballots20200927z$md5:194b8edf0e2ba64f25500ff4378369a4c                 C   s   |  |dd\}}d| d| d}| ||d d }t|dd	}|d }t|d
}t|dddtd}|s>tdddt|dd}	| d|	 d|}
||d t|d|	dd|
dS )Nr
   typez)https://www.projectveritas.com/page-data//z/page-data.jsonresultdatavideopost)imageogImagesrcmuxAsset)bodyjsoncontent.r   targetfieldsr   F)get_allexpected_typezNo video on the provided url.T)expected
playbackId)zen-USr$   zhttps://stream.mux.com/z.m3u8r   datez// )r
   r   r   r   formats)
_match_valid_urlgroup_download_jsonr   dictr   _extract_m3u8_formatsr   getreplace)selfr   video_id
video_typeapi_url	data_json	main_datar   	mux_assetplayback_idr'    r7   S/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/projectveritas.py_real_extract    s(   

zProjectVeritasIE._real_extractN)__name__
__module____qualname___WORKING
_VALID_URL_TESTSr9   r7   r7   r7   r8   r   	   s*    
r   N)commonr   utilsr   r   r   r   r7   r7   r7   r8   <module>   s    