
    i	                         S r SSKJrJr  SSKJr  SSKr " S S\5      r\R                  S	S
S.SSS.SSS.S.5      r	 " S S\5      r
 " S S\5      rg)z#Extractors for LynxChan Imageboards   )BaseExtractorMessage   )text    Nc                       \ rS rSrSrSrSrg)LynxchanExtractor   z"Base class for LynxChan extractorslynxchan N)__name__
__module____qualname____firstlineno____doc__basecategory__static_attributes__r       J/app/mltbenv/lib/python3.13/site-packages/gallery_dl/extractor/lynxchan.pyr	   r	      s
    ,Lr   r	   zhttps://bbw-chan.linkzbbw-chan\.(?:link|nl))rootpatternzhttps://kohlchan.netzkohlchan\.netzendchan\.(?:org|net|gg))zbbw-chankohlchanendchanc                   <    \ rS rSrSrSrSrSrSr\	S-   r
SrS	 rS
rg)LynxchanThreadExtractor#   zExtractor for LynxChan threadsthread)z
{category}z
{boardUri}z!{threadId} {subject|message[:50]}z){postId}{num:?-//} {filename}.{extension}z{boardUri}_{postId}_{num}z/([^/?#]+)/res/(\d+)z$https://endchan.org/a/res/12345.htmlc              #   R  #    U R                    SU R                  S    SU R                  S    S3nU R                  U5      nUS   US'   UR                  SS	5      n[        R
                  S
U4v   [        R                  " U4U5       H  nUR                  SS	5      =n(       d  M  UR                  U5        [        U5       HZ  u  pgUR                  U5        XgS'   U R                   US   -   n[        R                  " US   U5        [        R                  X4v   M\     M     g 7f)N//res/z.jsonthreadIdpostIdpostsr    filesnumpathoriginalName)r   groupsrequest_jsonpopr   	Directory	itertoolschainupdate	enumerater   nameext_from_urlUrl)selfurlr   r%   postr'   r(   files           r   itemsLynxchanThreadExtractor.items-   s    1T[[_-U4;;r?2C5I""3'!*-x

7B'V++OOVIu5D"--u-d#!*5!1ICKK'"%K))d6l2C))$~*>E!++s00 "2 6s   B"D'(A?D'r   N)r   r   r   r   r   subcategorydirectory_fmtfilename_fmtarchive_fmtBASE_PATTERNr   exampler9   r   r   r   r   r   r   #   s0    (K:M>L-K44G4G1r   r   c                   0    \ rS rSrSrSr\S-   rSrS r	Sr
g)	LynxchanBoardExtractor?   zExtractor for LynxChan boardsboardz&/([^/?#]+)(?:/index|/catalog|/\d+|/?$)zhttps://endchan.org/a/c              #      #    U R                   S   nU R                   SU S3nU R                  U5       H8  nU R                   SU SUS    S3n[        US'   [        R
                  X#4v   M:     g 7f)Nr"   r   z/catalog.jsonr!   r#   z.html
_extractor)r+   r   r,   r   r   Queue)r5   rD   r6   r   s       r   r9   LynxchanBoardExtractor.itemsE   sx     B1UG=1'',FYYKquVJ-?,@FC#:F< --,, -s   A0A2r   N)r   r   r   r   r   r;   r?   r   r@   r9   r   r   r   r   rB   rB   ?   s    'KFFG&G-r   rB   )r   commonr   r   r&   r   r/   r	   r1   r?   r   rB   r   r   r   <module>rJ      su    * *   
 !'''+
 '#
 -)  1/ 18-. -r   