
    i                        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 " S S\5      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 " S S\
5      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))*uA  Exception classes used by gallery-dl

Class Hierarchy:

Exception
 └── GalleryDLException
      ├── ExtractionError
      │    ├── HttpError
      │    │    └── ChallengeError
      │    ├── AuthorizationError
      │    │    └── AuthRequired
      │    ├── AuthenticationError
      │    └── NotFoundError
      ├── InputError
      │    ├── FormatError
      │    │    ├── FilenameFormatError
      │    │    └── DirectoryFormatError
      │    ├── FilterError
      │    ├── InputFileError
      │    └── NoExtractorError
      └── ControlException
           ├── StopExtraction
           ├── AbortExtraction
           ├── TerminateExtraction
           └── RestartExtraction
c                   .    \ rS rSrSrSrSrSrSS jrSr	g)GalleryDLException%   z#Base class for GalleryDL exceptionsN   c                 "   U(       d  U R                   nO0[        U[        5      (       a  UR                  R                   SU 3nU(       a)  U R
                  b  U R
                  R                  SU5      nXl        [        R                  X5        g )Nz: z{})	default
isinstance	Exception	__class____name__msgfmtreplacemessage__init__)selfr   fmts      A/app/mltbenv/lib/python3.13/site-packages/gallery_dl/exception.pyr   GalleryDLException.__init__+   sm    llG++ **334Bwi@G4;;*kk))$8G4)    )r   )NT)
r   
__module____qualname____firstlineno____doc__r   r   coder   __static_attributes__ r   r   r   r   %   s    -GFD*r   r   c                       \ rS rSrSrSrSrg)ExtractionError9   z7Base class for exceptions during information extraction   r   Nr   r   r   r   r   r   r   r   r   r   r   r   9   s
    ADr   r   c                   &    \ rS rSrSrSrSS jrSrg)	HttpError>   z*HTTP request during data extraction failedzHTTP request failedNc                     X l         Uc  SU l        OBUR                  U l        U(       d*  SUR                   SUR                   SUR                   S3n[
        R                  X5        g )N    ' z' for ')responsestatusstatus_codereasonurlr   r   )r   r   r(   s      r   r   HttpError.__init__B   sc     DK"..DKx334Ahoo5F G##+<<.3  /r   )r(   r)   ) N)r   r   r   r   r   r   r   r   r   r   r   r"   r"   >   s    4#G	0r   r"   c                       \ rS rSrSrS rSrg)ChallengeErrorN      c                     U SUR                    SUR                   SUR                   S3n[        R	                  XU5        g )Nz (r'   z) for 'r&   )r*   r+   r,   r"   r   )r   	challenger(   r   s       r   r   ChallengeError.__init__Q   sL    kH0018??2C DLL>$ 	 	4(3r   r   N)r   r   r   r   r   r   r   r   r   r   r0   r0   N   s    D4r   r0   c                        \ rS rSrSrSrSrSrg)AuthenticationErrorX   z$Invalid or missing login credentialszInvalid login credentials   r   Nr   r   r   r   r   r   r   r   r   r   r   r7   r7   X   s    .)GDr   r7   c                        \ rS rSrSrSrSrSrg)AuthorizationError^   z,Insufficient privileges to access a resourcez/Insufficient privileges to access this resourcer9   r   Nr:   r   r   r   r<   r<   ^   s    6?GDr   r<   c                   "    \ rS rSrSrSS jrSrg)AuthRequiredd   zAccount credentials requiredNc                     U(       aX  [        U[        5      (       d  SR                  U5      nU(       a  SU;  a  SU 3nSU 3nOSnU(       a  SU S3OSnU SU U 3n[        R	                  X5        g )	Nz or r'   zthis z to access r.   z ('z')z needed)r   strjoinr<   r   )r   authresourcer   s       r   r   AuthRequired.__init__g   s|    dC(({{4(h&!&xj1H(
3+2G9B'GghZy9G##D2r   r   )NrE   N)r   r   r   r   r   r   r   r   r   r   r?   r?   d   s    ,G3r   r?   c                        \ rS rSrSrSrSrSrg)NotFoundErrorx   z5Requested resource (gallery/image) could not be foundzRequested {} could not be foundzresource (gallery/image)r   N)r   r   r   r   r   r   r   r   r   r   r   rH   rH   x   s    ?.F(Gr   rH   c                       \ rS rSrSrSrSrg)
InputError   z-Error caused by user input and config options    r   Nr    r   r   r   rK   rK      s
    7Dr   rK   c                       \ rS rSrSrSrg)FormatError   z!Error while building output pathsr   Nr   r   r   r   r   r   r   r   r   rO   rO      s    +r   rO   c                       \ rS rSrSrSrSrg)FilenameFormatError   z%Error while building output filenamesz+Applying filename format string failed ({})r   Nr   r   r   r   r   r   r   r   r   r   rS   rS      s
    /:Fr   rS   c                       \ rS rSrSrSrSrg)DirectoryFormatError   z+Error while building output directory pathsz,Applying directory format string failed ({})r   NrU   r   r   r   rW   rW      s
    5;Fr   rW   c                       \ rS rSrSrSrSrg)FilterError   z*Error while evaluating a filter expressionz(Evaluating filter expression failed ({})r   NrU   r   r   r   rZ   rZ      s
    47Fr   rZ   c                       \ rS rSrSrSrg)InputFileError   z Error when parsing an input filer   NrQ   r   r   r   r]   r]      s    *r   r]   c                       \ rS rSrSrSrg)NoExtractorError   z%No extractor can handle the given URLr   NrQ   r   r   r   r`   r`          /r   r`   c                       \ rS rSrSrSrg)ControlException   r%   r   N)r   r   r   r   r   r   r   r   r   rd   rd      s    Dr   rd   c                   "    \ rS rSrSrSS jrSrg)StopExtraction   zStop data extractionNc                    [         R                  U 5        Uc  S U l        SU l        g [	        U[
        5      (       a  S U l        Xl        g UR                  5       (       a  S U l        [        U5      U l        g Xl        SU l        g )Nr      )rd   r   targetdepthr   int	isdecimal)r   rk   s     r   r   StopExtraction.__init__   si    !!$'>DKDJ$$DKJDKVDJ KDJr   )rl   rk   )N)r   r   r   r   r   r   r   r   r   r   rg   rg      s
    r   rg   c                       \ rS rSrSrSrg)AbortExtraction   z%Abort data extraction due to an errorr   NrQ   r   r   r   rq   rq      rb   r   rq   c                       \ rS rSrSrSrg)TerminateExtraction   zTerminate data extractionr   NrQ   r   r   r   rt   rt      s    #r   rt   c                       \ rS rSrSrSrg)RestartExtraction   zRestart data extractionr   NrQ   r   r   r   rw   rw      s    !r   rw   N)r   r	   r   r   r"   r0   r7   r<   r?   rH   rK   rO   rS   rW   rZ   r]   r`   rd   rg   rq   rt   rw   r   r   r   <module>ry      s  8* *(( 
0 0 4Y 4/  3% 3()O )# 
,* ,;+ ;
<; <
8* 8
+Z +0z 0) % (0o'7 0$* $"( "r   