U
    y^
                     @   sT   d dl mZ ddlmZ ddlmZmZmZmZm	Z	 ddl
mZ G dd deZd	S )
    )unicode_literals   )InfoExtractor   )ExtractorErrorget_element_by_attributeparse_durationtry_getupdate_url_query)
compat_strc                
   @   sR   e 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gZdZdd ZdS )
USATodayIEz;https?://(?:www\.)?usatoday\.com/(?:[^/]+/)*(?P<id>[^?/#]+)zmhttp://www.usatoday.com/media/cinematic/video/81729424/us-france-warn-syrian-regime-ahead-of-new-peace-talks/Z 033587d2529dc3411a1ab3644c3b8827Z4799374959001mp4z6US, France warn Syrian regime ahead of new peace talksiVz$md5:7e50464fdf2126b0f533748d3c78d58f29906170001Z20160313)idexttitle	timestampdescriptionuploader_idupload_date)urlmd5	info_dictzzhttps://www.usatoday.com/story/tech/science/2018/08/21/yellowstone-supervolcano-eruption-stop-worrying-its-blow/973633002/Z5824495846001z4Yellowstone more likely to crack rather than explodei{[z$md5:3715e7927639a4f16b474e9391687c62Z28911775001Z20180820)r   r   zFhttp://players.brightcove.net/%s/default_default/index.html?videoId=%sc              
   C   s   |  |}| t|ddi|}tdd|}|s<tddd| ||}t|dd	 tpZi }d
| j|	dd|	dp||d f t
|d |d |	d|	dt|	dddS )NZajaxtrueclasszui-video-datazno video on the webpageT)expectedc                 S   s   | d d S )NZasset_metadataitems )xr   r   PC:\Users\TaGoRe\Desktop\beinconnect-dl\binaries\youtube_dl\extractor\usatoday.py<lambda>4       z*USATodayIE._real_extract.<locals>.<lambda>url_transparentZbrightcoveaccountr   Zbrightcoveidbrightcove_idr   r   	thumbnailr   lengthBrightcoveNew)_typer   r   r   r$   r   durationie_key)	_match_id_download_webpager
   r   r   _parse_jsonr	   dictBRIGHTCOVE_URL_TEMPLATEgetr   r   )selfr   
display_idwebpageZui_video_data
video_dataitemr   r   r   _real_extract-   s     
"
zUSATodayIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSr.   r5   r   r   r   r   r      s2   r   N)
__future__r   commonr   utilsr   r   r   r	   r
   compatr   r   r   r   r   r   <module>   s   