o
    {#iC                     @   s   d Z ddlmZmZ G dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZdS )z'Library specific exception definitions.    )PatternUnionc                   @      e Zd ZdZdS )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__ r   r   X/var/www/GraceOrthoHospital/venv_grace/lib/python3.10/site-packages/pytube/exceptions.pyr          r   c                   @   r   )MaxRetriesExceededz#Maximum number of retries exceeded.Nr   r   r   r   r   r      r   r   c                   @   r   )HTMLParseErrorzHTML could not be parsedNr   r   r   r   r   r      r   r   c                   @   r   )ExtractErrorz Data extraction based exception.Nr   r   r   r   r   r      r   r   c                       s2   e Zd ZdZdedeeef f fddZ  ZS )RegexMatchErrorz)Regex pattern did not return any matches.callerpatternc                    s&   t  | d|  || _|| _dS )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__r   r   r      s   
zRegexMatchError.__init__)	r   r   r	   r
   strr   r   r   __classcell__r   r   r   r   r      s    &r   c                       2   e Zd ZdZdef fddZedd Z  ZS )VideoUnavailablezBase video unavailable error.video_idc                    s   || _ t | j dS zN
        :param str video_id:
            A YouTube video identifier.
        N)r   r   r   error_stringr   r   r   r   r   r   +      zVideoUnavailable.__init__c                 C      | j  dS )Nz is unavailabler   r   r   r   r   r   3      zVideoUnavailable.error_string	r   r   r	   r
   r   r   propertyr   r   r   r   r   r   r   )   
    r   c                       r   )AgeRestrictedErrorz>Video is age restricted, and cannot be accessed without OAuth.r   c                       || _ t | j  dS r   r   r   r   r    r   r   r   r   :   r!   zAgeRestrictedError.__init__c                 C   r"   )Nz= is age restricted, and can't be accessed without logging in.r#   r$   r   r   r   r   B   r%   zAgeRestrictedError.error_stringr&   r   r   r   r   r)   8   r(   r)   c                       r   )LiveStreamErrorzVideo is a live stream.r   c                    r*   r   r+   r    r   r   r   r   I   r!   zLiveStreamError.__init__c                 C   r"   )Nz' is streaming live and cannot be loadedr#   r$   r   r   r   r   Q   r%   zLiveStreamError.error_stringr&   r   r   r   r   r,   G   r(   r,   c                       .   e Zd Zdef fddZedd Z  ZS )VideoPrivater   c                    r*   r   r+   r    r   r   r   r   W   r!   zVideoPrivate.__init__c                 C   r"   )Nz is a private videor#   r$   r   r   r   r   _   r%   zVideoPrivate.error_stringr   r   r	   r   r   r'   r   r   r   r   r   r   r.   V       r.   c                       r-   )RecordingUnavailabler   c                    r*   r   r+   r    r   r   r   r   e   r!   zRecordingUnavailable.__init__c                 C   r"   )Nz0 does not have a live stream recording availabler#   r$   r   r   r   r   m   r%   z!RecordingUnavailable.error_stringr/   r   r   r   r   r1   d   r0   r1   c                       r   )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                    r*   r   r+   r    r   r   r   r   y   r!   zMembersOnly.__init__c                 C   r"   )Nz is a members-only videor#   r$   r   r   r   r      r%   zMembersOnly.error_stringr&   r   r   r   r   r2   r   s
    r2   c                       r-   )VideoRegionBlockedr   c                    r*   r   r+   r    r   r   r   r      r!   zVideoRegionBlocked.__init__c                 C   r"   )Nz  is not available in your regionr#   r$   r   r   r   r      r%   zVideoRegionBlocked.error_stringr/   r   r   r   r   r3      r0   r3   N)r
   typingr   r   	Exceptionr   r   r   r   r   r   r)   r,   r.   r1   r2   r3   r   r   r   r   <module>   s    	