
    V|h                         S SK Jr  SSKJrJrJrJrJrJrJ	r	J
r
JrJr   " S S\5      r " S S\5      r " S S	\5      rg
)   )InfoExtractor   )
ExtractorErrorbool_or_nonedict_getfloat_or_noneint_or_nonestr_or_nonetraverse_objtry_geturl_or_noneurljoinc                   "    \ rS rSrSrSrS rSrg)GettrBaseIE   zhttps?://(www\.)?gettr\.com/zhttps://media.gettr.com/c                 J    U R                   " [        SU5      U/UQ70 UD6S   $ )Nzhttps://api.gettr.com/u/result)_download_jsonr   )selfpathvideo_idargskwargss        P/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/gettr.py	_call_apiGettrBaseIE._call_api   s/    ""7+Et#LhhY]haghiqrr     N)__name__
__module____qualname____firstlineno___BASE_REGEX_MEDIA_BASE_URLr   __static_attributes__r   r   r   r   r      s    1K0Osr   r   c                       \ rS rSr\R
                  S-   rSSSSSSS	S
SSSSS/S.S.SSSSSSSSSSSSS.S.SSS.SSS.S SS.S!SS"/S#./rS$ rS%r	g&)'GettrIE   zpost/(?P<id>[a-z0-9]+)z%https://www.gettr.com/post/pcf6uv838f
pcf6uv838fz$md5:9086a646bbd06c41c4fe8e52b3c93454z$md5:be0577f1e4caadc06de4a002da2bf287mp4EpochTVepochtv20210927zre:^https?://.+/out\.jpggFTAgsh|GM@hornofafricaexplorations)idtitledescriptionextuploaderuploader_idupload_date	thumbnail	timestampdurationtagsurl	info_dictzhttps://gettr.com/post/p4iahpp4iahpz$md5:b03c07883db6fbc1aab88877a6c3b149z$md5:741b7419d991c403196ed2ea7749a39dzNeues Forum Freiheitnf_freiheit20210718g%<A   zcount:12z!https://gettr.com/post/pxn5b743a9T)r<   only_matchingz!https://gettr.com/post/pxtiiz5ca2z!https://gettr.com/post/pxlu8p3b13z!https://gettr.com/post/pv6wp9e24cYoutube)r<   rB   add_iec                    ^ U R                  U5      nU R                  X5      nU R                  SU S3U5      nUR                  S5      m[	        UU4S j[
        5      =(       d    0 nTR                  S5      nTR                  S5      nTR                  S5      S:X  a  U R                  S	U 3S
US9$ U(       do  U(       dh  [        TR                  S5      5      n[        USS[        S9n	U(       a  U R                  U5      $ U	(       a  U R                  SU	 3SU	S9$ [        S5      e[        TR                  S5      =(       d    U R                  U5      5      =p[        UR                  S5      =(       d     U R                  SU R                  USS9SSS95      nU(       a  U SU
 3n
U(       a(  U R                  [!        U R"                  U5      USSSSS9O/ 0 4u  pU(       a[  UR%                  [!        U R"                  U5      SS['        TR                  S 5      5      ['        TR                  S!5      5      S".5        UU
UUUU[        [)        US#S$/5      =(       d    TR                  S%5      5      [        [!        U R"                  TR                  S&5      5      =(       d    U R+                  S'S(/US)SS95      [-        [)        TS*S+/5      S,S-9[-        TR                  S.5      5      TR                  S/5      S0.$ )1Nzpost/z?incl="poststats|userinfo"datac                     > U S   S   TS      $ )Nauxuinfuidr   )x	post_datas    r   <lambda>'GettrIE._real_extract.<locals>.<lambda>R   s    %0@5AQ0Rr   vidovidp_typestreamzhttps://gettr.com/streaming/GettrStreaming)ier   prevsrc)rH   shrdpst_id)rF   rpstIds    )expected_typezhttps://gettr.com/post/GettrzThere's no video in this post.txtnicknamez^(.+?) on GETTR )defaultr4   F)fatalz - r*   m3u8_nativehls)entry_protocolm3u8_idr`   vid_widvid_hgt)r<   	format_idr3   widthheightrW   usernamerJ   mainzog:imageimager7   cdateudate  scalevid_durhtgs)r0   r1   r2   formats	subtitlesr4   r5   r7   r8   r9   r:   )	_match_id_download_webpager   getr   dict
url_resultr   r   strr   r
   _og_search_description_search_regex_og_search_title#_extract_m3u8_formats_and_subtitlesr   r$   appendr	   r   _html_search_metar   )r   r<   post_idwebpageapi_data	user_datarO   rP   	embed_urlshared_post_idr1   r2   r4   rt   ru   rL   s                  @r   _real_extractGettrIE._real_extractL   s   ..%((6>>E'2L"MwWLL(	H&RTXY_]_	mmE"}}V$=="h.??%A'#KP`kr?ss#IMM)$<=I)(4MOeuxyNy11)@@P'QV]hvww$%FGG)MM% HD$?$?$HJ 	J MM*% {!!"4d6K6KG]_6K6`blty!z| jE7+E JM "EED((#.(%u F FSUWYRZ 	 NNt33T:#$Y]]9%=>%immI&>?  &" &UJ$78 (==') %,,immF.CD d)):w*?+]b)ce 'x	GW;M'NVZ[%immI&>?MM&)
 	
r   r   N)
r   r    r!   r"   r   r#   
_VALID_URL_TESTSr   r%   r   r   r   r'   r'      s    ((+DDJ 7;A!$%4'#^4
  /;A.(%4'
" 3 3 3 3+	U/Fb@
r   r'   c                   |    \ rS rSr\R
                  S-   rSSSS\SSS	S
SSSS.S.SSSS\SSSS
SSSS.S./rS r	Sr
g)GettrStreamingIE   zstreaming/(?P<id>[a-z0-9]+)z&https://gettr.com/streaming/psoiulc122
psoiulc122r*   z$md5:56bca4b8f48f1743d9fd03d49c723017zCorona Investigative Committeecoronacommitteegw/<@zre:^https?://.+z3Day 1: Opening Session of the Grand Jury Proceedingg~J٫A20220205)r0   r3   r2   
view_countr4   r5   r9   r7   r1   r8   r6   r;   z&https://gettr.com/streaming/psfmeefcc1
psfmeefcc1z Session 90: "The Virus Of Power"z$md5:98986acdf656aa836bf36f9c9704c65bg r \@gyEA20220204)r0   r3   r1   r   r5   r2   r4   r7   r9   r8   r6   c                    U R                  U5      nU R                  SU 3U0 S9nUS   n[        UR                  S5      5      nU(       a  U R	                  XRSSSSS	9O/ 0 4u  pg[        US
 [        5      =(       d    /  Vs/ s H  nS[        U R                  U5      0PM     n	nU[        US [        5      [        US [        5      UUU	[        US [        5      [        US [        5      [        UR                  S5      5      [        UR                  S5      SS9[        UR                  S5      SS9[        UR                  S5      5      S.$ s  snf )Nz
live/join/)rF   	broadcastr<   r*   ra   rb   F)r3   rc   rd   r`   c                     U S   S   $ )NpostDataimgsr   rK   s    r   rM   0GettrStreamingIE._real_extract.<locals>.<lambda>   s    :v9Nr   c                     U S   S   $ )Nr   ttlr   r   s    r   rM   r      s    1Z=3Gr   c                     U S   S   $ )Nr   dscr   r   s    r   rM   r      s    :u9Mr   c                     U S   S   $ )NliveHostInfor]   r   r   s    r   rM   r      s    a6G
6Sr   c                     U S   S   $ )Nr   rW   r   r   s    r   rM   r      s    >9J59Qr   
viewsCountstartAtro   rp   r9   isLive)r0   r1   r2   rt   ru   
thumbnailsr4   r5   r   r8   r9   is_live)rv   r   r   rx   r   r   listr   r$   r{   r	   r   r   )
r   r<   r   
video_info	live_infolive_urlrt   ru   r7   r   s
             r   r   GettrStreamingIE._real_extract   sj   >>#&^^j
$;XB^O
{+	y}}U34 JR "EEE(%u F FXZ\^W_ 	 #:/NPTU[Y[[][i 74//;
[ 	 ]
 Z)GM":/MsS"$
,SUXY":/QSVW%immL&AB&y}}Y'?tL%immJ&?tL#IMM($;<
 	
	]s   "Er   N)r   r    r!   r"   r   r#   r   intr   r   r%   r   r   r   r   r      s    ((+IIJ 8A8, +J'%
  87,A8+!'%
F@
r   r   N)commonr   utilsr   r   r   r   r	   r
   r   r   r   r   r   r'   r   r   r   r   <module>r      s@    !  s- st
k t
n?
{ ?
r   