
    VGh                     f    d dl Z ddlmZ ddlmZ  G d de      Z G d de      Z G d	 d
e      Zy)    N   )AMPIE)InfoExtractorc                       e Zd ZdZdZdZdddddd	d
dddddidddddddddddddi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!d,d#d-d.d/d0d.d/gZed1        Zd2 Z	y3)4	FoxNewsIEfoxnewszFox News and Fox Business Videozfhttps?://video\.(?:insider\.)?fox(?:news|business)\.com/v/(?:video-embed\.html\?video_id=)?(?P<id>\d+)z)https://video.foxnews.com/v/63206538361126320653836112mp4z>Tucker Carlson joins 'Gutfeld!' to discuss his new documentaryre:^https?://.*\.jpg$i  20230217z$md5:858a8a36f59e9ca897d758855bcdfa02g   A)idexttitle	thumbnaildurationupload_datedescription	timestampskip_downloadm3u8url	info_dictparamsaE  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=true509937733100182416_censoring20160826g   Ai	  )r   r   r   r   r   r   r   r   z@http://video.foxnews.com/v/3937480/frozen-in-time/#sp=show-clips 32aaded6ba3ef0d1c04e238d01031e5e3937480flvzFrozen in Timez#16-year-old girl is size of toddleri	  icM20110503)r   r   r   r   r   r   r   r   404 page)r   md5r   skipzqhttp://video.foxnews.com/v/3922535568001/rep-luis-gutierrez-on-if-obamas-immigration-plan-is-legal/#sp=show-clips 5846c64a1ea05ec78175421b8323e2df3922535568001z;Rep. Luis Gutierrez on if Obama's immigration plan is legalz&Congressman discusses president's plani$  i_T20141204z"m3u8 HTTP error 400 in web browserzPhttp://video.foxnews.com/v/video-embed.html?video_id=3937480&d=video.foxnews.comTr   only_matchingz,http://video.foxbusiness.com/v/4442309889001c              #   n   K   t        j                  d|      D ]  }d|j                  d         y w)Nz(?x)
                    <(?:script|(?:amp-)?iframe)[^>]+\bsrc=["\']
                    (?:https?:)?//video\.foxnews\.com/v/(?:video-embed\.html|embed\.js)\?
                    (?:[^>"\']+&)?(?:video_)?id=(?P<video_id>\d+)
                z6https://video.foxnews.com/v/video-embed.html?video_id=video_id)refinditergroup)clsr   webpagemobjs       a/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/foxnews.py_extract_embed_urlszFoxNewsIE._extract_embed_urlsQ   sE     KK  	dD K4::V`KaJbcc	ds   35c                 `    | j                  |      }| j                  d| d|       }||d<   |S )Nz(https://api.foxnews.com/v3/video-player/z?callback=uid_r   )	_match_id_extract_feed_info)selfr   r+   infos       r2   _real_extractzFoxNewsIE._real_extract[   s?    >>#&&&6xjxjY[T
    N)
__name__
__module____qualname__IE_NAMEIE_DESC
_VALID_URL_TESTSclassmethodr3   r9    r:   r2   r   r      s   G/GzJ ?%[5)E)	 '/	
  [%*0))5	 '/	
  V5)D')5	 	
  G5%VG')5	 9	
  f!	

 B!	
ADFL d dr:   r   c                   V    e Zd ZdZdddddddd	d
dddidddddddddddddgZd Zy)FoxNewsVideoIEz1https?://(?:www\.)?foxnews\.com/video/(?P<id>\d+)z+https://www.foxnews.com/video/63286322861126328632286112r
   zReview: 2023 Toyota Prius Prime   zre:^https://.+\.jpg$g  @A20230602z$md5:b69aafb125b41c1402e9744f53d6edc4)r   r   r   r   r   r   r   r   r   r   r   z+https://www.foxnews.com/video/63130586641126313058664112z're:https://.+/1280x720/match/image\.jpg20220930z"New York City, Kids Therapy, Bidenio	  z!Gutfeld! - Thursday, September 29i6c)r   r   r   r   r   r   r   r   r"   r   r   r$   c                 X    | j                  |      }| j                  d| t        |      S )Nzhttps://video.foxnews.com/v/)r5   
url_resultr   )r7   r   r+   s      r2   r9   zFoxNewsVideoIE._real_extract   s,    >>#&!=hZH)U]^^r:   N)r;   r<   r=   r@   rA   r9   rC   r:   r2   rE   rE   d   so    EJ<!60%%A	
 #F+ =!C%?8#	
 F8_r:   rE   c                   d    e Zd ZdZdZddddddd	d
dddddiddddddddddddddddgZd Zy )!FoxNewsArticleIEzKhttps?://(?:www\.)?(?:insider\.)?foxnews\.com/(?!v)([^/]+/)+(?P<id>[a-z-]+)zfoxnews:articlezqhttps://www.foxnews.com/politics/2016/09/08/buzz-about-bud-clinton-camp-denies-claims-wore-earpiece-at-forum.html d2dd6ce809cedeefa96460e9648214375116295019001r
   z7Trump and Clinton asked to defend positions on Iraq Warz\Veterans and Fox News host Dana Perino react on 'The Kelly File' to NBC's presidential forumi5W20160908r   i  )r   r   r   r   r   r   r   r   r   r   )r   r#   r   r   zhttps://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=true5748266721001r    z<Kyle Kashuv has a positive message for the Trump White Housez;Marjory Stoneman Douglas student disagrees with classmates.   inZ20180309)r   r   r   r   r   r   r   r   r"   rK   z`http://insider.foxnews.com/2016/08/25/univ-wisconsin-student-group-pushing-silence-certain-wordsTr(   c                 H   | j                  |      }| j                  ||      }| j                  d|ddd       }|r'| j                  d|z   t        j                               S | j                  t        t        j                  ||            t        j                               S )Nz&data-video-id=([\'"])(?P<id>[^\'"]+)\1zvideo IDr   )r.   defaultzhttp://video.foxnews.com/v/)r5   _download_webpage_html_search_regexrM   r   ie_keynextr3   )r7   r   
display_idr0   r+   s        r2   r9   zFoxNewsArticleIE._real_extract   s    ^^C(
((j9**5ZtT + ; ??-8):J:J:LN N ..sG<=y?O?O?QS 	Sr:   N)r;   r<   r=   r@   r>   rA   r9   rC   r:   r2   rO   rO      s    _JG C1!N|#%1	
 #F+" t!SX1#%	
  r; FDSr:   rO   )r,   ampr   commonr   r   rE   rO   rC   r:   r2   <module>r_      s:    	  !Z Zz _]  _F2S} 2Sr:   