
    gC                         d Z ddlmZmZ  G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z	 G d de      Z
 G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Zy)z'Library specific exception definitions.    )PatternUnionc                       e Zd ZdZy)PytubeErrorzBase pytube exception that all others inherit.

    This is done to not pollute the built-in exceptions, which *could* result
    in unintended errors being unexpectedly and incorrectly handled within
    implementers code.
    N__name__
__module____qualname____doc__     Z/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/pytube/exceptions.pyr   r      s    r   r   c                       e Zd ZdZy)MaxRetriesExceededz#Maximum number of retries exceeded.Nr   r   r   r   r   r      s    -r   r   c                       e Zd ZdZy)HTMLParseErrorzHTML could not be parsedNr   r   r   r   r   r      s    "r   r   c                       e Zd ZdZy)ExtractErrorz Data extraction based exception.Nr   r   r   r   r   r      s    *r   r   c                   6     e Zd ZdZdedeeef   f fdZ xZS )RegexMatchErrorz)Regex pattern did not return any matches.callerpatternc                 J    t         |   | d|        || _        || _        y)z
        :param str caller:
            Calling function
        :param str pattern:
            Pattern that failed to match
        z: could not find match for N)super__init__r   r   )selfr   r   	__class__s      r   r   zRegexMatchError.__init__   s,     	F8#>wiHIr   )	r   r	   r
   r   strr   r   r   __classcell__r   s   @r   r   r      s'    3	s 	U3<-@ 	 	r   r   c                   8     e Zd ZdZdef fdZed        Z xZS )VideoUnavailablezBase video unavailable error.video_idc                 F    || _         t        | 	  | j                         yzN
        :param str video_id:
            A YouTube video identifier.
        N)r#   r   r   error_stringr   r#   r   s     r   r   zVideoUnavailable.__init__+   s    
 !**+r   c                      | j                    dS )Nz is unavailabler#   r   s    r   r&   zVideoUnavailable.error_string3   s    --00r   	r   r	   r
   r   r   r   propertyr&   r   r    s   @r   r"   r"   )   s&    ', , 1 1r   r"   c                   8     e Zd ZdZdef fdZed        Z xZS )AgeRestrictedErrorz>Video is age restricted, and cannot be accessed without OAuth.r#   c                 F    || _         t        | 	  | j                          yr%   r#   r   r   r'   s     r   r   zAgeRestrictedError.__init__:       
 !'r   c                      | j                    dS )Nz= is age restricted, and can't be accessed without logging in.r)   r*   s    r   r&   zAgeRestrictedError.error_stringB   s    -- ]^^r   r+   r    s   @r   r.   r.   8   s(    H( ( _ _r   r.   c                   8     e Zd ZdZdef fdZed        Z xZS )LiveStreamErrorzVideo is a live stream.r#   c                 F    || _         t        | 	  | j                          yr%   r0   r'   s     r   r   zLiveStreamError.__init__I   r1   r   c                      | j                    dS )Nz' is streaming live and cannot be loadedr)   r*   s    r   r&   zLiveStreamError.error_stringQ   s    -- GHHr   r+   r    s   @r   r4   r4   G   s(    !( ( I Ir   r4   c                   4     e Zd Zdef fdZed        Z xZS )VideoPrivater#   c                 F    || _         t        | 	  | j                          yr%   r0   r'   s     r   r   zVideoPrivate.__init__W   r1   r   c                      | j                    dS )Nz is a private videor)   r*   s    r   r&   zVideoPrivate.error_string_   s    -- 344r   r   r	   r
   r   r   r,   r&   r   r    s   @r   r8   r8   V   s#    ( ( 5 5r   r8   c                   4     e Zd Zdef fdZed        Z xZS )RecordingUnavailabler#   c                 F    || _         t        | 	  | j                          yr%   r0   r'   s     r   r   zRecordingUnavailable.__init__e   r1   r   c                      | j                    dS )Nz0 does not have a live stream recording availabler)   r*   s    r   r&   z!RecordingUnavailable.error_stringm   s    -- PQQr   r;   r    s   @r   r=   r=   d   s%    ( ( R Rr   r=   c                   8     e Zd ZdZdef fdZed        Z xZS )MembersOnlyzVideo is members-only.

    YouTube has special videos that are only viewable to users who have
    subscribed to a content creator.
    ref: https://support.google.com/youtube/answer/7544492?hl=en
    r#   c                 F    || _         t        | 	  | j                          yr%   r0   r'   s     r   r   zMembersOnly.__init__y   r1   r   c                      | j                    dS )Nz is a members-only videor)   r*   s    r   r&   zMembersOnly.error_string   s    -- 899r   r+   r    s   @r   rA   rA   r   s(    ( ( : :r   rA   c                   4     e Zd Zdef fdZed        Z xZS )VideoRegionBlockedr#   c                 F    || _         t        | 	  | j                          yr%   r0   r'   s     r   r   zVideoRegionBlocked.__init__   r1   r   c                      | j                    dS )Nz  is not available in your regionr)   r*   s    r   r&   zVideoRegionBlocked.error_string   s    -- @AAr   r;   r    s   @r   rE   rE      s%    ( ( B Br   rE   N)r   typingr   r   	Exceptionr   r   r   r   r   r"   r.   r4   r8   r=   rA   rE   r   r   r   <module>rJ      s    - !) . .#[ #+; +l 1{ 1_) _I& I5# 5R+ R:" :(B) Br   