o
    i                     @   s@   d dl Z ddlmZ ddlmZmZmZmZ G dd deZdS )    N   )InfoExtractor   )determine_extint_or_none	qualitiesunescapeHTMLc                
   @   s>   e Zd ZdZdddddddd	d
dddddgZdd ZdS )GiantBombIEzXhttps?://(?:www\.)?giantbomb\.com/(?:videos|shows)/(?P<display_id>[^/]+)/(?P<id>\d+-\d+)zLhttp://www.giantbomb.com/videos/quick-look-destiny-the-dark-below/2300-9782/ 132f5a803e7e0ab0e274d84bda1e77aez	2300-9782z!quick-look-destiny-the-dark-belowmp4z#Quick Look: Destiny: The Dark Belowz$md5:0aa3aaf2772a41b91d44c63f30dfad24i_	  zre:^https?://.*\.jpg$)id
display_idexttitledescriptionduration	thumbnail)urlmd5	info_dictz8https://www.giantbomb.com/shows/ben-stranding/2970-20212T)r   only_matchingc                 C   sL  |  |}|d}|d}| ||}| |}| |}| |}tt| 	d|d}	t
|	d}
tg d}g }|	d  D ]G\}}|dkrNqEt|}|d	krn| |d
 |}|rm|||d d< || qE|dkr|| j||ddddd qE|||||d qE|s|	d}|r| |dS ||||||
|dS )Nr   r   zdata-video="([^"]+)"z
data-videolengthSeconds)f4m_lowprogressive_lowf4m_highprogressive_highf4m_hdprogressive_hdvideoStreams
f4m_streamf4mz?hdcore=3.3.1r   qualitym3u8r   m3u8_nativehlsF)r   entry_protocolm3u8_idfatal)r   	format_idr!   	youtubeIDYoutube)r   r   r   r   r   r   formats)_match_valid_urlgroup_download_webpage_og_search_title_og_search_description_og_search_thumbnailjsonloadsr   _search_regexr   getr   itemsr   _extract_f4m_formatsextend_extract_m3u8_formatsappend
url_result)selfr   mobjvideo_idr   webpager   r   r   videor   r!   r+   r(   	video_urlr   f4m_formats
youtube_id rD   N/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/giantbomb.py_real_extract   sZ   










zGiantBombIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSrF   rD   rD   rD   rE   r	      s$    r	   )	r2   commonr   utilsr   r   r   r   r	   rD   rD   rD   rE   <module>   s    