U
    g                     @   s<   d dl Z ddlmZ ddlmZmZmZ G dd deZdS )    N   )InfoExtractor   )determine_extparse_durationunified_strdatec                	   @   sF   e Zd ZdZdZdgZdddddd	d
ddddidgdZdd ZdS )
HuffPostIEzHuffington Postz(?x)
        https?://(embed\.)?live\.huffingtonpost\.com/
        (?:
            r/segment/[^/]+/|
            HPLEmbedPlayer/\?segmentId=
        )
        (?P<id>[0-9a-f]+)zP<iframe[^>]+?src=(["\'])(?P<url>https?://embed\.live\.huffingtonpost\.com/.+?)\1zMhttp://live.huffingtonpost.com/r/segment/legalese-it/52dd3e4b02a7602131000677Z 55f5e8981c1c80a64706a44b74833de8Z52dd3e4b02a7602131000677mp4zLegalese It! with @MikeSacksHPzThis week on Legalese It, Mike talks to David Bosco about his new book on the ICC, "Rough Justice," he also discusses the Virginia AG's historic stance on gay marriage, the execution of Edgar Tamayo, the ICC's delay of Kenya's President and more.  i  Z20140124)idexttitledescriptiondurationupload_dateZskip_downloadTzHTTP Error 404: Not Found)urlmd5Z	info_dictparamsZexpected_warningsc              
   C   s  |  |}d| d}| ||d }|d }t|d}t|di dpX|d}|d	}g }	td |d
  D ],}td|}
|
sq||		||

dd q|g }|di }t|di  t|di   }|D ]\}}t|}|dkr|| j||dddd q|dkrD|| j|d |ddd q|	||ddd||drhdnd d q|||||||	dS ) Nz2http://embed.live.huffingtonpost.com/api/segments/z.jsondatar   Zrunning_timescheduleZ	starts_atZsegment_start_date_timer   Zimagesz.*-([0-9]+x[0-9]+)\.r   )r   
resolutionsourcesZliveZ
live_againZm3u8r	   ZhlsF)r   Zm3u8_idfatalZf4mz?hdcore=2.9.5Zhds)Zf4m_idr   /.zaudio/none)formatZ	format_idr   r   Zvcodec)r
   r   r   formatsr   r   
thumbnails)Z	_match_idZ_download_jsonr   getr   filtervaluesrematchappendgrouplistitemsr   extendZ_extract_m3u8_formatsZ_extract_f4m_formatsreplace
startswith)selfr   Zvideo_idZapi_urlr   Zvideo_titler   r   r   r   mr   r   Zlive_sourceskeyr    r-   =/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/huffpost.py_real_extract(   sj    


(
    

   


	zHuffPostIE._real_extractN)__name__
__module____qualname__ZIE_DESCZ
_VALID_URLZ_EMBED_REGEXZ_TESTr/   r-   r-   r-   r.   r      s$   
 r   )r!   commonr   utilsr   r   r   r   r-   r-   r-   r.   <module>   s   