
    VGh%
                     :    d dl Z ddlmZ ddlmZ  G d de      Zy)    N   )InfoExtractor   )fix_xml_ampersandsc                   D    e Zd ZdZdddddddd	d
ddddddddgZd Zy)MetacriticIEz;https?://(?:www\.)?metacritic\.com/.+?/trailers/(?P<id>\d+)zQhttp://www.metacritic.com/game/playstation-4/infamous-second-son/trailers/36982223698222mp4z;inFamous: Second Son - inSide Sucker Punch: Smoke & MirrorszwTake a peak behind-the-scenes to see how Sucker Punch brings smoke into the universe of inFAMOUS Second Son on the PS4.   )idexttitledescriptiondurationzNot providing trailers anymore)url	info_dictskipzohttp://www.metacritic.com/game/playstation-4/tales-from-the-borderlands-a-telltale-game-series/trailers/57403155740315z>Tales from the Borderlands - Finale: The Vault of the TravelerzIn the final episode of the season, all hell breaks loose. Jack is now in control of Helios' systems, and he's ready to reclaim his rightful place as king of Hyperion (with or without you).r   )r   r   c           	         | j                  |      }|j                  d      | j                  |      }| j                  dz   dt              }t        fd|j                  d      D              }g }|j                  d      D ]W  }|j                  d      j                  }|j                  d	      j                  }	|j                  |	d
|t        |      d       Y | j                  d|dt        j                        }
|j                  d      j                  ||
t        |j                  d      j                        dS )Nr   z+http://www.metacritic.com/video_data?video=zDownloading info xml)transform_sourcec              3   `   K   | ]%  }|j                  d       j                  k(  s"| ' yw)r   N)findtext).0cvideo_ids     d/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/metacritic.py	<genexpr>z-MetacriticIE._real_extract.<locals>.<genexpr>)   s'     ^!t@Q@QU]@]A^s   #..zplayList/clipzhttpURI/videoFileratefilePathr
   )r   r   	format_idtbrz<b>Description:</b>(.*?)</p>r   )flagsr   r   )r   r   formatsr   r   )_match_valid_urlgroup_download_webpage_download_xmlr   nextfindallr   r   appendint_html_search_regexreDOTALL)selfr   mobjwebpageinfoclipr%   
video_filerate_str	video_urlr   r   s              @r   _real_extractzMetacriticIE._real_extract!   sA   $$S)::d#((h7!!"ORZ"Z"*,BUg " i ^t||O<^^,,':; 	J!v.33H"
388INN %8}	 	 --.M.5}BII . W YYw',,&DIIj1667
 	
    N)__name__
__module____qualname__
_VALID_URL_TESTSr9    r:   r   r   r   	   s\    OJ cR U
 1
 AU ]
	F*
r:   r   )r/   commonr   utilsr   r   r@   r:   r   <module>rC      s    	 !
5
= 5
r:   