
    VGhl
                     >    d dl mZ ddlmZmZmZmZ  G d de      Zy)   )InfoExtractor   )int_or_nonestr_or_nonetraverse_objurl_or_nonec                   X    e Zd ZdZdZdddddddd	d
ddededddidddddddgZd Zy)
GoodGameIEzgoodgame:streamz2https?://goodgame\.ru/(?!channel/)(?P<id>[\w.*-]+)z https://goodgame.ru/TGW#autoplay7998mp4ur   re:шоуматч Happy \(NE\) vs Fortitude \(UD\), потом ладдер и дс \d{4}-\d{2}-\d{2} \d{2}:\d{2}$zhttps://goodgame.ru/TGWz-https://hls.goodgame.ru/previews/7998_240.jpgTGWJosephStalinis_live   2899)idext
channel_idtitlechannel_url	thumbnailuploaderchannellive_status	age_limitchannel_follower_countuploader_idconcurrent_view_countskip_downloadm3u8)url	info_dictparamszhttps://goodgame.ru/Mr.GrayT)r!   only_matchingz"https://goodgame.ru/HeDoPa3yMeHue*c                    | j                  |      }| j                  d| d|      }|d   }g i }}|j                  d      r| j                  d| d|dd	      \  }}n| j	                  d
d|       |||t        |      dt        |dt        hfdt        hfdt        hfdt        hfddt        hfddt        hfdt        h| j                  hfdt        hfdt        hfdt
        hd hfd
      S )Nz https://goodgame.ru/api/4/users/z/stream	streamkeystatusz!https://hls.goodgame.ru/manifest/z_master.m3u8r   T)livezUser is offline)expectedvideo_id)r   formats	subtitlesr   r   
channelkeyr   linkstreamerusernamepreviewviewers	followersadultc                     | rdS d S )Nr    )xs    b/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/goodgame.py<lambda>z*GoodGameIE._real_extract.<locals>.<lambda>C   s    " t     )
r   r   r   r   r   r   r   r   r   r   )	_match_id_download_jsonget#_extract_m3u8_formats_and_subtitlesraise_no_formatsboolr   strr   r   _proto_relative_urlr   )selfr!   channel_nameresponse	player_idr+   r,   s          r8   _real_extractzGoodGameIE._real_extract'   s>   ~~c*&&)I,W^'_amn[)	<<!!%!I!I3I;lKe$ "J "0GY !!"3d\!Z "G}	

 8!C5)(3%0#k]3 &6'cU; *D;-@'+9Q9Q8RS*3k])C+6*F%v0K/LM& 
 	
r:   N)__name__
__module____qualname__IE_NAME
_VALID_URLint_TESTSrG   r6   r:   r8   r
   r
   
   ss    GFJ1  K4H%$&)!%(
 #F+#& - 4+F4
r:   r
   N)commonr   utilsr   r   r   r   r
   r6   r:   r8   <module>rQ      s    ! ;
 ;
r:   