
    iN                         S r SSKJrJrJr  SSKJrJr  Sr " S S\5      r	 " S S	\	5      r
 " S
 S\	5      r " S S\	5      r " S S\	5      r " S S\\	5      rg)z-Extractors for https://www.simply-hentai.com/   )	ExtractorGalleryExtractorMessage   )textutilz*(?:https?://)?(?:www\.)?simply-hentai\.comc                   >    \ rS rSrSrSrSrSrSrS r	SS	 jr
S
 rSrg)SimplyhentaiExtractor   z&Base class for simplyhentai extractorssimplyhentaizhttps://www.simply-hentai.comz https://api-v3.simply-hentai.comfirefoxc              #      #    U R                  5        HV  n[        US'   UR                  S5      =n(       a  US   OSnU R                   SU SUS    3n[        R
                  XA4v   MX     g 7f)N
_extractorseriesslugz8-original-work/)	galleriesSimplyhentaiGalleryExtractorgetrootr   Queue)selfgallerysr   urls        N/app/mltbenv/lib/python3.13/site-packages/gallery_dl/extractor/simplyhentai.pyitemsSimplyhentaiExtractor.items   sp     ~~'G$@GL!)0X)>$>A$>ai' YYKq'&/):;C---- (s   A,A.Nc                 x    U R                    SU 3nU R                  X2U R                  S-   U R                  S.S9$ )Nz/v3r   )RefererOrigin)paramsheaders)root_apirequest_jsonr   )r   endpointr"   r   s       r   request_api!SimplyhentaiExtractor.request_api    sE    s8*-  yy3yy>
   	    c              #   V  #    [         R                  " UR                  S5      S5      US'    U R                  X5      n[	        US   [
        5      (       a  US   S    S h  vN   OUS    S h  vN    US   US   S   :  a  g  US==   S-  ss'   Mh   N3 N'! [         a     g f = f7f)Npager   dataalbums
paginationpages)r   	parse_intr   r'   
isinstancedict	Exception)r   r&   r"   r,   s       r   _pagination!SimplyhentaiExtractor._pagination'   s     

6(:A>v##H5D$v,--<111<''&>T,%7%@@ A 6NaN  2'
  sH   AB)!B"B)/B0B)5B B)B)
B&#B)%B&&B) )N)__name__
__module____qualname____firstlineno____doc__categoryr   r$   browserr   r'   r4   __static_attributes__r6   r)   r   r
   r
      s(    0H*D1HG. r)   r
   c                   ,    \ rS rSrSr\S-   rSrS rSr	g)SimplyhentaiSeriesExtractor:   r   zV/series/([^/?#]+)(?:/tag-([^/?#]+))?(?:/sort-([^/?#]+))?(?:/page-(\d+))?(?:\?([^#]+))?z)https://www.simply-hentai.com/series/SLUGc                     U R                   u  pp4n[        R                  " U5      nUb  X&S'   Ub  X6S'   Ub  XFS'   U R                  SU-   U5      $ )Ntag_slugsortr+   z/series/groupsr   parse_queryr4   )r   r   tagrD   pnumqsr"   s          r   r   %SimplyhentaiSeriesExtractor.galleriesA   sa    $(KK!4r!!"%?!$:!6N!6N
T 16::r)   r6   N
r7   r8   r9   r:   subcategoryBASE_PATTERNpatternexampler   r>   r6   r)   r   r@   r@   :   s"    K ! !G :G	;r)   r@   c                   ,    \ rS rSrSr\S-   rSrS rSr	g)SimplyhentaiMangaExtractorM   mangaz;/2-mangas(?:/sort-([^/?#]+))?(?:/page-(\d+))?(?:\?([^#]+))?z&https://www.simply-hentai.com/2-mangasc                     U R                   u  pn[        R                  " U5      nUb  XS'   Ub  X$S'   U R                  SU5      $ )NrD   r+   z/mangasrE   )r   rD   rI   rJ   r"   s        r   r   $SimplyhentaiMangaExtractor.galleriesS   sL    B!!"%!6N!6N	622r)   r6   NrL   r6   r)   r   rR   rR   M   s"    K E EG6G3r)   rR   c                   ,    \ rS rSrSr\S-   rSrS rSr	g)SimplyhentaiTagExtractor]   rH   z/(parody|tag|character|collection|artist|translator)/([^/?#]+)(?:/tag-([^/?#]+))?(?:/sort-([^/?#]+))?(?:/page-(\d+))?(?:\?([^#]+))?z%https://www.simply-hentai.com/tag/TAGc                     U R                   u  pp4pV[        R                  " U5      nUS:X  a  SU-   nO	SU-   nXS'   Ub  X7S'   Ub  XGS'   Ub  XWS'   U R                  X5      $ )N
collectionz/collection//tag/typerC   rD   r+   rE   )	r   r]   r   rH   rD   rI   rJ   r"   r&   s	            r   r   "SimplyhentaiTagExtractor.galleriesf   s|    *.++'Ct!!"%<%,H~H!6N?!$:!6N!6N11r)   r6   NrL   r6   r)   r   rX   rX   ]   s"    K!!G
 6G2r)   rX   c                   ,    \ rS rSrSr\S-   rSrS rSr	g)SimplyhentaiLanguageExtractorw   languagezE/language/([^/?#]+)(?:/sort-([^/?#]+))?(?:/page-(\d+))?(?:\?([^#]+))?z+https://www.simply-hentai.com/language/LANGc                     U R                   u  pp4[        R                  " U5      nSUS'   Ub  X%S'   Ub  X5S'   U R                  SU-   U5      $ )Nrb   r]   rD   r+   r\   rE   )r   rb   rD   rI   rJ   r"   s         r   r   'SimplyhentaiLanguageExtractor.galleries}   s[    #';; !!"%#v!6N!6N( 2F;;r)   r6   NrL   r6   r)   r   r`   r`   w   s"    K E EG;G<r)   r`   c                   6    \ rS rSrSrSr\S-   rSrS r	S r
Srg	)
r      z$Extractor for simplyhentai galleriesz{id}z/[^/?#]+/([^/?#]+)z)https://www.simply-hentai.com/SERIES/SLUGc                    SU R                   S   -   nU R                  U5      S   nUR                  S5      US'   UR                  S5      =n=(       a    UR                  S5      US'   U R	                  UR                  S5      5      US	'   S
 H2  nUR                  U5      =(       d    S Vs/ s H  ofS   PM	     snX5'   M4     UR                  SS 5        UR                  SS5      U l        UR                  SS5      S:  a
  US-   U l         US   S   =US'   n[        R                  " U5      US'    UR                  S5      S   S   US'   U$ s  snf ! [         a     N.f = f! [         a     U$ f = f)Nz/manga/    r,   id
gallery_idr   title
created_atdate)artists
charactersparodiestagstranslatorsr6   relatedimagesimage_count       z/pagesrb   namelangpreviewsizesfullcover)	rF   r'   popr   parse_datetime_iso_imagesr   language_to_coder3   )r   _r&   r,   r   keytrb   s           r   metadata%SimplyhentaiGalleryExtractor.metadata   s   t{{1~-)&1!XXd^\#xx11!EquuW~X..txx/EFV+C-1XXc]-@b-@A-@7-@ADI+ 	D!xx"-88M2&+#h.DL	*.z*:6*BBDx00:DL	 HHY/8@DM % B  		
  		s*   -E&E 5E& 
E#"E#&
E43E4c                     U R                   n[        U[        5      (       a  U R                  U5      S   S   nU Vs/ s H  o3S   S   SUS   04PM     sn$ s  snf )Nr,   r/   r{   r|   ri   )r   r1   strr'   )r   r   imgsimgs       r   rt   #SimplyhentaiGalleryExtractor.images   s_    ||dC  ##D)&1':DEIJTcWf%c$i'89TJJJs   A)r   N)r7   r8   r9   r:   r;   archive_fmtrN   rO   rP   r   rt   r>   r6   r)   r   r   r      s%    .K22G9G:Kr)   r   N)r;   commonr   r   r    r   r   rN   r
   r@   rR   rX   r`   r   r6   r)   r   <module>r      sk    4 8 8 <& I & R;"7 ;&3!6 3 24 24<$9 <"'K#35J 'Kr)   