
    V|h-                     :    S SK r SSKJr  SSKJr   " S S\5      rg)    N   )InfoExtractor   )ExtractorErrorc                   &    \ rS rSrSrSrSrS rSrg)	TestURLIE   z7Allows addressing of the test cases as test:yout.*be_1 Fz6test(?:url)?:(?P<extractor>.*?)(?:_(?P<num>\d+|all))?$c           	      "  ^
 SSK Jn  U R                  U5      R                  SS5      u  m
nT
(       d  SSUS.$ [        R
                  " T
[        R                  S9nU" 5        Vs/ s H&  oTR                  UR                  5      (       d  M$  UPM(     nn[        U5      S	:X  a  [        S
T
< S3SS9e[        U5      S:  aj  [        U
4S jU 5       S 5      =(       d    [        U
4S jU 5       S 5      nU(       d/  [        SR                  SR                  S U 5       5      5      SS9eOUS	   n[        UR                  S5      5      nUS:X  aB  U R!                  U V	s/ s H  oR#                  U	S   U5      PM     sn	XR                   S35      $  U[%        U=(       d    S	5         n	U R)                  SU	S    35        U R#                  U	S   U5      $ s  snf s  sn	f ! [&         a$    [        SU=(       d    S	 S[        U5       S3SS9ef = f)Nr   )gen_extractor_classes	extractornumz:test )idtitleurl)flagsr   zNo extractors matching z foundT)expectedc              3      >#    U  H4  oR                   R                  5       TR                  5       :X  d  M0  Uv   M6     g 7fN)IE_NAMElower.0ieextractor_ids     R/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/testurl.py	<genexpr>*TestURLIE._real_extract.<locals>.<genexpr>   s2      0rJJ4D4D4F,J\J\J^4^0s   /?	?c              3      >#    U  HF  oR                   R                  S 5      S   R                  5       TR                  5       :X  d  MB  Uv   MH     g7f)+r   N)r   splitr   r   s     r   r   r      sC      0rJJ4D4DS4I!4L4R4R4TXdXjXjXl4l0s   AA	Az&Found multiple matching extractors: {} c              3   8   #    U  H  oR                   v   M     g 7fr   )r   )r   r   s     r   r   r   !   s     Lvbu\^ZZbus   allr   z testsz
Test case z not found, got only z
Test URL: )r   r   _match_valid_urlgrouprecompile
IGNORECASEsearchr   lenr   nextformatjointupleget_testcasesplaylist_result
url_resultint
IndexError	to_screen)selfr   r   r   rexematching_extractorsr   	testcasestcr   s             @r   _real_extractTestURLIE._real_extract   s   + 11#6<<[%Pc!Bs;;jjR]];*?*A[*AQZZPQPYPYEZq*A["#q( #:<:J&!Q\`aa$%) 0  0 
 $<CCCHHLvbuLvDvw!# # 
 ,A.I)11$78	%<''AJK2EI6K))*&13 3	c3sxa=)B
 	BuI;/0r%y)44; \( L  	c SXAJ&;C	N;K6R]ac c	cs   %#GGGG   .H N)	__name__
__module____qualname____firstlineno____doc__IE_DESC
_VALID_URLr<   __static_attributes__r>       r   r   r      s    BGJJ%5rG   r   )r'   commonr   utilsr   r   r>   rG   r   <module>rJ      s    	 ! "+5 +5rG   