U
    $P‘f$  ã                   @   sP   d dl mZ d dlZddlmZ ddlmZ G dd„ deƒZG dd	„ d	eƒZdS )
é    )Úunicode_literalsNé   )ÚAMPIE)ÚInfoExtractorc                   @   s†   e Zd Zd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ddœddidœdddœdddœdddœgZed d!„ ƒZd"d#„ Z	d$S )%Ú	FoxNewsIEZfoxnewszFox News and Fox Business Videozphttps?://(?P<host>video\.(?:insider\.)?fox(?:news|business)\.com)/v/(?:video-embed\.html\?video_id=)?(?P<id>\d+)z@http://video.foxnews.com/v/3937480/frozen-in-time/#sp=show-clipsZ 32aaded6ba3ef0d1c04e238d01031e5eZ3937480ÚflvzFrozen in Timez#16-year-old girl is size of toddleri	  ic½¿MZ20110503úre:^https?://.*\.jpg$)ÚidÚextÚtitleÚdescriptionÚdurationÚ	timestampÚupload_dateÚ	thumbnail©ÚurlÚmd5Ú	info_dictzqhttp://video.foxnews.com/v/3922535568001/rep-luis-gutierrez-on-if-obamas-immigration-plan-is-legal/#sp=show-clipsZ 5846c64a1ea05ec78175421b8323e2dfZ3922535568001Úmp4z;Rep. Luis Gutierrez on if Obama's immigration plan is legalz&Congressman discusses president's plani$  i_ÎTZ20141204Úskip_downloadT)r   r   r   ÚparamszPhttp://video.foxnews.com/v/video-embed.html?video_id=3937480&d=video.foxnews.com©r   Zonly_matchingz,http://video.foxbusiness.com/v/4442309889001aE  http://video.insider.foxnews.com/v/video-embed.html?video_id=5099377331001&autoplay=true&share_url=http://insider.foxnews.com/2016/08/25/univ-wisconsin-student-group-pushing-silence-certain-words&share_title=Student%20Group:%20Saying%20%27Politically%20Correct,%27%20%27Trash%27%20and%20%27Lame%27%20Is%20Offensive&share=truec                 C   s   dd„ t  d| ¡D ƒS )Nc                 S   s   g | ]}|  d ¡‘qS )r   )Úgroup)Ú.0Zmobj© r   ú@/tmp/pip-unpacked-wheel-7zdooeg3/youtube_dl/extractor/foxnews.pyÚ
<listcomp>?   s   ÿz+FoxNewsIE._extract_urls.<locals>.<listcomp>zw<(?:amp-)?iframe[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//video\.foxnews\.com/v/video-embed\.html?.*?\bvideo_id=\d+.*?)\1)ÚreÚfinditer)Úwebpager   r   r   Ú_extract_urls=   s    þþzFoxNewsIE._extract_urlsc                 C   s4   t  | j|¡ ¡ \}}|  d||f ¡}||d< |S )Nz)http://%s/v/feed/video/%s.js?template=foxr	   )r   ÚmatchÚ
_VALID_URLÚgroupsZ_extract_feed_info)Úselfr   ÚhostÚvideo_idÚinfor   r   r   Ú_real_extractE   s    
ÿzFoxNewsIE._real_extractN)
Ú__name__Ú
__module__Ú__qualname__ÚIE_NAMEZIE_DESCr#   Ú_TESTSÚstaticmethodr!   r)   r   r   r   r   r   	   sV   øýø þóþþý×0
r   c                   @   s`   e Zd 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didœdddœgZdd„ ZdS )ÚFoxNewsArticleIEzKhttps?://(?:www\.)?(?:insider\.)?foxnews\.com/(?!v)([^/]+/)+(?P<id>[a-z-]+)zfoxnews:articlezphttp://www.foxnews.com/politics/2016/09/08/buzz-about-bud-clinton-camp-denies-claims-wore-earpiece-at-forum.htmlZ 83d44e1aff1433e7a29a7b537d1700b5Z5116295019001r   z7Trump and Clinton asked to defend positions on Iraq Warz"Veterans react on 'The Kelly File'i5ÊÐWZ20160908)r	   r
   r   r   r   r   r   z¡http://www.foxnews.com/us/2018/03/09/parkland-survivor-kyle-kashuv-on-meeting-trump-his-app-to-prevent-another-school-shooting.amp.html?__twitter_impression=trueZ5748266721001r   z<Kyle Kashuv has a positive message for the Trump White Housez;Marjory Stoneman Douglas student disagrees with classmates.r   éå   iîn¢ZZ20180309)r	   r
   r   r   r   r   r   r   r   T)r   r   r   z`http://insider.foxnews.com/2016/08/25/univ-wisconsin-student-group-pushing-silence-certain-wordsr   c                 C   s\   |   |¡}|  ||¡}| jd|ddd d}|rB|  d| t ¡ ¡S |  t |¡d t ¡ ¡S )Nz&data-video-id=([\'"])(?P<id>[^\'"]+)\1zvideo IDr	   )r   Údefaultzhttp://video.foxnews.com/v/r   )Z	_match_idZ_download_webpageZ_html_search_regexZ
url_resultr   Zie_keyr!   )r%   r   Z
display_idr    r'   r   r   r   r)   s   s$    
   þ ÿ ÿzFoxNewsArticleIE._real_extractN)r*   r+   r,   r#   r-   r.   r)   r   r   r   r   r0   N   s>   úüø ÿóþä!r0   )	Ú
__future__r   r   Úampr   Úcommonr   r   r0   r   r   r   r   Ú<module>   s
   E