o
    i                     @   s(   d dl ZddlmZ G dd deZdS )    N   )InfoExtractorc                   @   s^   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dddddgZdd ZdS )
GameSpotIEz[https?://(?:www\.)?gamespot\.com/(?:video|article|review)s/(?:[^/]+/\d+-|embed/)(?P<id>\d+)zLhttp://www.gamespot.com/videos/arma-3-community-guide-sitrep-i/2300-6410818/ b2a30deaa8654fcccd43713a6b6a4825zgs-2300-6410818mp4z"Arma 3 - Community Guide: SITREP IzECheck out this video where some of the basics of Arma 3 is explained.)idexttitledescriptionz+manifest URL give HTTP Error 404: Not Found)urlmd5	info_dictskipzYhttp://www.gamespot.com/videos/the-witcher-3-wild-hunt-xbox-one-now-playing/2300-6424837/ 173ea87ad762cf5d3bf6163dceb255a6zgs-2300-6424837z&Now Playing - The Witcher 3: Wild HuntzRJoin us as we take a look at the early hours of The Witcher 3: Wild Hunt and more.)r   r   r   z.https://www.gamespot.com/videos/embed/6439218/T)r   only_matchingzYhttps://www.gamespot.com/articles/the-last-of-us-2-receives-new-ps4-trailer/1100-6454469/zBhttps://www.gamespot.com/reviews/gears-of-war-review/1900-6161188/c              	   C   s  |  |}| ||}| | jd|ddd|}tj|d }|d }g }|d}|rc| j||dd	d
dd}	|	D ](}
|	|
 |

 }|d= ||
d ddd|
d ddd |	| q:|d}|rv|| j||ddd |dp|||||| d|| |dS )Nzdata-video=(["\'])({.*?})\1z
video data   )groupr	   videoStreamsadaptive_streamr   m3u8_nativehlsF)m3u8_idfatalmanifest_url	format_idzhls-zhttp-httpr   z.m3u8z.mp4)r   protocolr   adaptive_dashdash)mpd_idr   guidr
   )r   
display_idr	   formatsr
   	thumbnail)	_match_id_download_webpage_parse_json_html_search_regexurllibparseunquoteget_extract_m3u8_formatsappendcopyupdatereplaceextend_extract_mpd_formats_html_search_meta_og_search_thumbnail)selfr   page_idwebpage
data_videor	   streamsr"   m3u8_urlm3u8_formatsfhttp_fmpd_url r?   M/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/gamespot.py_real_extract&   sN   




zGameSpotIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSrA   r?   r?   r?   r@   r      s<    
r   )urllib.parser(   commonr   r   r?   r?   r?   r@   <module>   s    