U
    g	                     @   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-8eb1ca5fd3c6Zmp4zLExclusive: Inside The New York and New Jersey Hospitals Battling CoronavirusZ20200327z$md5:6076477fe50b03eb8708be9415e18e1c)idexttitleupload_date	thumbnail)urlZ	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 ballotsZ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)imageZogImagesrcmuxAsset)bodyjsoncontent.r   targetfieldsr   F)get_allZ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)
Z_match_valid_urlgroupZ_download_jsonr   dictr   Z_extract_m3u8_formatsr   getreplace)selfr   Zvideo_idZ
video_typeZapi_urlZ	data_jsonZ	main_datar   Z	mux_assetZplayback_idr!    r'   C/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/projectveritas.py_real_extract    s,    
  
zProjectVeritasIE._real_extractN)__name__
__module____qualname__Z_WORKINGZ
_VALID_URLZ_TESTSr)   r'   r'   r'   r(   r   	   s(   
r   N)commonr   utilsr   r   r   r   r'   r'   r'   r(   <module>   s   