
    VGh                     F    d dl Z ddlmZ ddlmZmZmZmZ  G d de      Zy)    N   )InfoExtractor   )determine_extint_or_none	qualitiesunescapeHTMLc            
       <    e Zd ZdZdddddddd	d
dddddgZd Zy)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                 d   | j                  |      }|j                  d      }|j                  d      }| j                  ||      }| j                  |      }| j	                  |      }| j                  |      }t        j                  t        | j                  d|d                  }	t        |	j                  d            }
t        g d      }g }|	d   j                         D ]  \  }}|dk(  rt        |      }|d	k(  r8| j                  |d
z   |      }|s4 ||      |d   d<   |j!                  |       T|dk(  r'|j!                  | j#                  ||dddd             |j%                  || ||      d        |s%|	j                  d      }|r| j'                  |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_ids                     c/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/giantbomb.py_real_extractzGiantBombIE._real_extract   s   $$S)::d#ZZ-
((j9%%g.11':--g6	

<(:(:#Wl)< = > uyy9: < = $).$9$?$?$A 	 IyL(	*Ce|"77	O8SU_`07	0BKN9-NN;/t99zu]!  :  0 1 $!*&y1  	( ;/Jz9== $&" 
 	
    N)__name__
__module____qualname__
_VALID_URL_TESTSrH    rI   rG   r   r      sF    lJ]1=:A1
 JF"6
rI   r   )	r5   commonr   utilsr   r   r   r	   r   rO   rI   rG   <module>rR      s#     ! I
- I
rI   