Ë
    Fü´j$�  ã                  ó,  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
 ddlmZ ddlmZmZmZmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZ dd	lmZ dd
l m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z- 	 ddl.m/Z/ dZ0er8ddl2Z2e2jf                  dk\  rddlm4Z4 nddl5m4Z4 ddl6m7Z7m8Z8m9Z9 ddl:Zddl;Zddl(m<Z< e!jz                  Z=e!j|                  Z>e!j~                  Z?e!j€                  Z@ ed«      ZA G d„ d«      ZBy# e1$ r dZ/dZ0Y Œˆw xY w)zProvide the Reddit class.é    )ÚannotationsN)Úislice)Ú	getLogger)ÚIOÚTYPE_CHECKINGÚAnyÚcast)Úurlparse)	Ú
AuthorizerÚDeviceIDAuthorizerÚReadOnlyAuthorizerÚRedirectÚ	RequestorÚScriptAuthorizerÚTrustedAuthenticatorÚUntrustedAuthenticatorÚsession)Ú
BadRequest)Úmodels)ÚConfig)ÚAPI_PATHÚUSER_AGENT_FORMATÚ__version__)ÚClientExceptionÚ!MissingRequiredAttributeExceptionÚRedditAPIException)ÚObjector)Úupdate_checkFT)é   é   )ÚSelf)Ú	GeneratorÚIterableÚIterator)ÚRedditErrorItemÚprawc                  ó€  — e Zd ZdZ ej
                  d«      ZdZed,d„«       Z	ed-d„«       Z
e
j                  d.d„«       Z
d/d„Zd0d„Z	 d1d	d	d	d
œ	 	 	 	 	 	 	 	 	 	 	 d2d„Zd3d„Zd3d„Zd4d„Zd	d	d	dd	ddœ	 	 	 	 	 	 	 	 	 	 	 	 	 d5d„Zd6d„Zd3d„Zd	d	dœ	 	 	 	 	 d7d„Zd8d„Zd8d„Zd9d„Zd1d	dœd:d„Zd	d	d	dœ	 	 	 	 	 	 	 	 	 d;d„Zd<d„Zd	dœ	 	 	 	 	 d=d„Zd	d	d	d œ	 	 	 	 	 	 	 d>d!„Zd	d	d	dœ	 	 	 	 	 	 	 	 	 d;d"„Zd	d	d	d	d#œ	 	 	 	 	 	 	 	 	 	 	 d?d$„Zd	d	d%œ	 	 	 	 	 	 	 d@d&„Z d1d	d'œdAd(„Z!d	d	d	d	d#œ	 	 	 	 	 	 	 	 	 	 	 	 	 d5d)„Z"d1d	dœdBd*„Z#dCd+„Z$y	)DÚRedditaî  The Reddit class provides convenient access to Reddit's API.

    Instances of this class are the gateway to interacting with Reddit's API through
    PRAW. The canonical way to obtain an instance of this class is via:

    .. code-block:: python

        import praw

        reddit = praw.Reddit(
            client_id="CLIENT_ID",
            client_secret="CLIENT_SECRET",
            password="PASSWORD",
            user_agent="USERAGENT",
            username="USERNAME",
        )

    z.([0-9]{1,3}) (milliseconds?|seconds?|minutes?)Fc                óH   — | j                   }| xj                   dz  c_         |S ©Né   )Ú_unique_counter)ÚselfÚvalues     úI/root/workspace/ytshorts/venv/lib/python3.12/site-packages/praw/reddit.pyÚ_next_uniquezReddit._next_unique^   s#   € à×$Ñ$ˆØ×Ò Ñ!ÕØˆó    c                ó4   — | j                   | j                  k(  S )z/``True`` when using the ``ReadOnlyAuthorizer``.)Ú_coreÚ_read_only_core©r-   s    r/   Ú	read_onlyzReddit.read_onlyd   s   € ð �z‰z˜T×1Ñ1Ñ1Ð1r1   c                ó€   — |r| j                   | _        y| j                  €d}t        |«      ‚| j                  | _        y)zÊSet or unset the use of the ReadOnlyAuthorizer.

        :raises: :class:`.ClientException` when attempting to unset ``read_only`` and
            only the ``ReadOnlyAuthorizer`` is available.

        NzFread_only cannot be unset as only the ReadOnlyAuthorizer is available.)r4   r3   Ú_authorized_corer   )r-   r.   Úmsgs      r/   r6   zReddit.read_onlyi   s=   € ñ Ø×-Ñ-ˆD�JØ×"Ñ"Ð*ØZˆCÜ! #Ó&Ð&à×.Ñ.ˆD�Jr1   c                ó   — | S )z Handle the context manager open.© r5   s    r/   Ú	__enter__zReddit.__enter__y   s   € àˆr1   c                 ó   — y)z!Handle the context manager close.Nr;   )r-   Ú_s     r/   Ú__exit__zReddit.__exit__}   s   � r1   N)Úconfig_interpolationÚrequestor_classÚrequestor_kwargsc               óF  — dx| _         x| _        | _        |  d| _        	 |xs t	        j
                  d«      xs d}t        ||fi |¤Ž| _        d}	dD ]J  }
t        | j                  |
«      | j                  j                  dhv sŒ2t        |	j                  |
«      «      ‚ | j                  j                  | j                  j                  u r|	j                  d	«      › d
�}t        |«      ‚| j!                  «        | j#                  «        | j%                  ||¬«       t'        j(                  | d«      | _        	 t'        j,                  | d«      | _        	 t'        j0                  | d«      | _        	 t'        j4                  | «      | _        	 t'        j8                  | d«      | _        	 t'        j<                  | d«      | _        	 t'        j@                  | d«      | _!        	 t'        jD                  | «      | _#        	 t'        jH                  | d«      | _%        	 t'        jL                  | d«      | _'        	 t'        jP                  | d«      | _)        	 t'        jT                  | «      | _+        y# t        j                  $ r"}d}|�|xj                  d|› �z  c_
        ‚ d}~ww xY w)aÚ	  Initialize a :class:`.Reddit` instance.

        :param site_name: The name of a section in your ``praw.ini`` file from which to
            load settings from. This parameter, in tandem with an appropriately
            configured ``praw.ini``, file is useful if you wish to easily save
            credentials for different applications, or communicate with other servers
            running Reddit. If ``site_name`` is ``None``, then the site name will be
            looked for in the environment variable ``praw_site``. If it is not found
            there, the ``DEFAULT`` site will be used (default: ``None``).
        :param config_interpolation: Config parser interpolation type that will be
            passed to :class:`.Config` (default: ``None``).
        :param requestor_class: A class that will be used to create a requestor. If not
            set, use ``prawcore.Requestor`` (default: ``None``).
        :param requestor_kwargs: Dictionary with additional keyword arguments used to
            initialize the requestor (default: ``None``).

        Additional keyword arguments will be used to initialize the :class:`.Config`
        object. This can be used to specify configuration settings during instantiation
        of the :class:`.Reddit` instance. For more details, please see
        :ref:`configuration`.

        Required settings are:

        - ``client_id``
        - ``client_secret`` (for installed applications set this value to ``None``)
        - ``user_agent``

        The ``requestor_class`` and ``requestor_kwargs`` allow for customization of the
        requestor :class:`.Reddit` will use. This allows, e.g., easily adding behavior
        to the requestor or wrapping its |Session|_ in a caching layer. Example usage:

        .. |Session| replace:: ``Session``

        .. _session: https://requests.readthedocs.io/en/stable/api/#request-sessions

        .. code-block:: python

            import json

            import requests
            from prawcore import Requestor

            from praw import Reddit


            class JSONDebugRequestor(Requestor):
                def request(self, *args, **kwargs):
                    response = super().request(*args, **kwargs)
                    print(json.dumps(response.json(), indent=4))
                    return response


            my_session = requests.Session()
            reddit = Reddit(
                ..., requestor_class=JSONDebugRequestor, requestor_kwargs={"session": my_session}
            )

        Nr   Ú	praw_siteÚDEFAULTa/  You provided the name of a praw.ini configuration which does not exist.

For help with creating a Reddit instance, visit
https://praw.readthedocs.io/en/latest/code_overview/reddit_instance.html

For help on configuring PRAW, visit
https://praw.readthedocs.io/en/latest/getting_started/configuration.htmlú
z´Required configuration setting {!r} missing. 
This setting can be provided in a praw.ini file, as a keyword argument to the Reddit class constructor, or as an environment variable.)Ú	client_idÚ
user_agentÚclient_secretzr
For installed applications this value must be set to None via a keyword argument to the Reddit class constructor.©rA   rB   ),r3   r8   r4   r,   ÚosÚgetenvr   ÚconfigÚconfigparserÚNoSectionErrorÚmessageÚgetattrÚCONFIG_NOT_SETr   ÚformatrI   Ú_check_for_updateÚ_prepare_objectorÚ_prepare_prawcorer   ÚAuthÚauthÚAnnouncementHelperÚannouncementsÚDraftHelperÚdraftsÚFrontÚfrontÚInboxÚinboxÚ
LiveHelperÚliveÚMultiredditHelperÚmultiredditÚRedditModNotesÚnotesÚ	RedditorsÚ	redditorsÚSubredditHelperÚ	subredditÚ
SubredditsÚ
subredditsÚUserÚuser)r-   Ú	site_namer@   rA   rB   Úconfig_settingsÚconfig_sectionÚexcÚhelp_messageÚrequired_messageÚ	attributer9   s               r/   Ú__init__zReddit.__init__€   s¤  € ðF EIÐHˆŒ
ÐH�TÔ*¨TÔ-AÙØ ˆÔð	àÒ@œRŸY™Y {Ó3Ò@°yð ô ! Ð1EÑYÈÑYˆDŒKð;ð 	ð
 5ò 	\ˆIÜ�t—{‘{ IÓ.°4·;±;×3MÑ3MÈtÐ2TÒTÜ7Ð8H×8OÑ8OÐPYÓ8ZÓ[Ð[ð	\ð �;‰;×$Ñ$¨¯©×(BÑ(BÑBØ%×,Ñ,¨_Ó=Ð>ð  ?rð  sˆCÜ3°CÓ8Ð8à×ÑÔ Ø×ÑÔ Ø×Ñ¨ÐQaÐÔbä—K‘K  dÓ+ˆŒ	ð	ô $×6Ñ6°t¸TÓBˆÔð	ô( ×(Ñ(¨¨tÓ4ˆŒð	ô$ —\‘\ $Ó'ˆŒ
ð		ô —\‘\ $¨Ó-ˆŒ
ð	ô ×%Ñ% d¨DÓ1ˆŒ	ð		ô "×3Ñ3°D¸$Ó?ˆÔð		ô ×*Ñ*¨4Ó0ˆŒ
ð	ô0  ×)Ñ)¨$°Ó5ˆŒð
	ô  ×/Ñ/°°dÓ;ˆŒð	ô2 !×+Ñ+¨D°$Ó7ˆŒð
	ô —K‘K Ó%ˆŒ	ð		øô_ ×*Ñ*ò 
	ðcð ð Ð$Ø—’  L >Ð2Ñ2•Øûð
	ús    /I+ É+J É>JÊJ c                ó  — | j                   j                  rdt        t        dd «      }|� |«       j                  j
                  dk(  ry d}	 t        j                  «        d}|rt        j                  d«       y y y # t        $ r Y Œ%w xY w)NÚget_ipythonÚZMQInteractiveShellFTa  It appears that you are using PRAW in an asynchronous environment.
It is strongly recommended to use Async PRAW: https://asyncpraw.readthedocs.io.
See https://praw.readthedocs.io/en/latest/getting_started/multiple_instances.html#discord-bots-and-asynchronous-environments for more info.
)rM   Úcheck_for_asyncrQ   ÚbuiltinsÚ	__class__Ú__name__ÚasyncioÚget_running_loopÚ	ExceptionÚloggerÚwarning)r-   rx   Úin_asyncs      r/   Ú_check_for_asynczReddit._check_for_async¦  s‹   € Ø�;‰;×&Ò&ä!¤(¨M¸4Ó@ˆKØÐ&©;«=×+BÑ+B×+KÑ+KÐOdÒ+dØØˆHðÜ×(Ñ(Ô*Ø�ñ Ü—‘ð(õð ð 'øô ò Ùðús   ÁA< Á<	BÂBc                ó¶   — t         st        €y t        j                  s<| j                  j
                  r%t        t        xs dt        ¬«       dt        _        y y y )Nr&   )Úpackage_nameÚpackage_versionT)ÚUPDATE_CHECKER_MISSINGr   r(   Úupdate_checkedrM   Úcheck_for_updatesÚ__package__r   r5   s    r/   rT   zReddit._check_for_update¼  sB   € Ý!¤\Ð%9ØÜ×$Ò$¨¯©×)FÒ)FÜ¤kÒ&;°VÌ[ÕYØ$(ŒFÕ!ð *GÐ$r1   c                óÈ  — |j                   D ]Ó  }|j                  dk(  sŒ|j                  €Œ | j                  j	                  |j                  «      }|s y t        |j                  d«      «      }|j                  d«      j                  d«      r|dz  }n"|j                  d«      j                  d«      rd}|t        | j                  j                  «      k  sŒÎ|dz   c S  y )NÚ	RATELIMITr+   é   Úminuteé<   Úmillisecondr   )
ÚitemsÚ
error_typerP   Ú_ratelimit_regexÚsearchÚintÚgroupÚ
startswithrM   Úratelimit_seconds)r-   Ú	exceptionÚitemÚamount_searchÚsecondss        r/   Ú_handle_rate_limitzReddit._handle_rate_limitÃ  sÌ   € Ø—O‘Oò 	'ˆDØ�‰ +Ó-°$·,±,Ñ2JØ $× 5Ñ 5× <Ñ <¸T¿\¹\Ó J�Ù$Øð ô ˜m×1Ñ1°!Ó4Ó5�Ø ×&Ñ& qÓ)×4Ñ4°XÔ>Ø˜r‘M‘GØ"×(Ñ(¨Ó+×6Ñ6°}ÔEØ�GØœc $§+¡+×"?Ñ"?Ó@Ó@Ø" Q™;Ò&ð	'ð r1   Ú ©ÚdataÚfilesÚjsonÚmethodÚparamsÚpathc          
     ód   — | j                   j                  | j                  ||||||¬«      ¬«      S )aä  Run a request through the ``Objector``.

        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param files: Dictionary, filename to file (like) object mapping (default:
            ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.
        :param method: The HTTP method (e.g., ``"GET"``, ``"POST"``, ``"PUT"``,
            ``"DELETE"``).
        :param params: The query parameters to add to the request (default: ``None``).
        :param path: The path to fetch.

        r    )r¡   )Ú	_objectorÚ	objectifyÚrequest)r-   r¡   r¢   r£   r¤   r¥   r¦   s          r/   Ú_objectify_requestzReddit._objectify_requestÒ  sC   € ð2 �~‰~×'Ñ'Ø—‘ØØØØØØð ó ð (ó 	
ð 		
r1   c                óò   — | j                   j                  r"t        || j                   j                  ¬«      }n| j                  | _        y t        || j                   j                  ¬«      x| _        | _        y )N)ÚauthenticatorÚrefresh_token©Ú
authorizerÚwindow_size)rM   r®   r   r4   r3   r   r±   r8   )r-   r­   r°   s      r/   Ú_prepare_common_authorizerz!Reddit._prepare_common_authorizerö  sX   € Ø�;‰;×$Ò$Ü#°-ÈtÏ{É{×OhÑOhÔi‰Jà×-Ñ-ˆDŒJØÜ-4À
ÐX\×XcÑXc×XoÑXoÔ-pÐpˆŒ
�TÕ*r1   c                ó4  — i | j                   j                  d   t        j                  “| j                   j                  d   t        j                  “| j                   j                  d   t        j
                  “| j                   j                  d   t        j                  “| j                   j                  d   t        j                  “| j                   j                  d   t        j                  “dt        j                  “dt        j                  “d	t        j                  “d
t        j                  “dt        j                  “dt        j                  “dt        j                  “dt        j                   “dt        j"                  “dt        j$                  “dt        j&                  “i dt        j(                  “dt        j*                  “dt        j,                  “dt        j.                  “dt        j0                  “dt        j2                  “dt        j4                  “dt        j6                  “dt        j8                  “dt        j:                  “dt        j                  “dt        j<                  “dt        j>                  “dt        j@                  “d t        jB                  “d!t        jD                  “d"t        jF                  “¥t        jH                  t        jJ                  t        jL                  t        jN                  t        jP                  t        jR                  t        jT                  t        jV                  t        jX                  t        jZ                  t        j\                  t        j^                  d#œ¥}ta        | |«      | _1        y )$NÚcommentrP   ÚredditorÚ
submissionrj   ÚtrophyÚAnnouncementÚAnnouncementListingÚButtonÚ
CollectionÚDraftÚ	DraftListÚImageÚLabeledMultiÚListingÚ
LiveUpdateÚLiveUpdateEventÚMenuLinkÚModeratedListÚModmailActionÚModmailConversationzModmailConversations-listÚModmailMessageÚSubmenuÚ
TrophyListÚUserListÚUserSubredditÚannÚbuttonÚcalendarzcommunity-listÚcustomzid-cardÚimage)ÚmenuÚmod_noteÚ	modactionzmoderator-listÚ
moderatorsÚmorez
post-flairÚruleÚ
stylesheetzsubreddit-rulesÚtextareaÚwidget)2rM   Úkindsr   ÚCommentÚMessageÚRedditorÚ
SubmissionÚ	SubredditÚTrophyr¸   r¹   rº   r»   r¼   r½   r¾   ÚMultiredditrÀ   rÁ   Ú
LiveThreadrÃ   rÄ   rÅ   rÆ   ÚModmailConversationsListingrÇ   rÈ   rÉ   ÚRedditorListrË   ÚButtonWidgetÚCalendarÚCommunityListÚCustomWidgetÚIDCardÚImageWidgetÚMenuÚModNoteÚ	ModActionÚModeratorListingÚModeratorsWidgetÚMoreCommentsÚPostFlairWidgetÚRuleÚ
StylesheetÚRulesWidgetÚTextAreaÚWidgetr   r¨   )r-   Úmappingss     r/   rU   zReddit._prepare_objectorþ  s-  € ð/
Ø�K‰K×Ñ˜iÑ(¬&¯.©.ð/
à�K‰K×Ñ˜iÑ(¬&¯.©.ð/
ð �K‰K×Ñ˜jÑ)¬6¯?©?ð/
ð �K‰K×Ñ˜lÑ+¬V×->Ñ->ð	/
ð
 �K‰K×Ñ˜kÑ*¬F×,<Ñ,<ð/
ð �K‰K×Ñ˜hÑ'¬¯©ð/
ð œF×/Ñ/ð/
ð "¤6×#=Ñ#=ð/
ð ”f—m‘mð/
ð œ&×+Ñ+ð/
ð ”V—\‘\ð/
ð œ×)Ñ)ð/
ð ”V—\‘\ð/
ð œF×.Ñ.ð/
ð ”v—~‘~ð/
ð  œ&×+Ñ+ð!/
ð" œv×0Ñ0ñ#/
ð$ œŸ™ð%/
ð& œV×1Ñ1ð'/
ð( œV×1Ñ1ð)/
ð* "¤6×#=Ñ#=ð+/
ð, (¬×)KÑ)Kð-/
ð. œf×3Ñ3ð//
ð0 ”v—~‘~ð1/
ð2 œ&×+Ñ+ð3/
ð4 œ×+Ñ+ð5/
ð6 œV×1Ñ1ð7/
ð8 ”6×&Ñ&ð9/
ð: ”f×)Ñ)ð;/
ð< œŸ™ð=/
ð> œf×2Ñ2ð?/
ð@ ”f×)Ñ)ðA/
ðB ”v—}‘}ðC/
ðD ”V×'Ñ'ñE/
ôF —K‘KÜŸ™Ü×)Ñ)Ü$×5Ñ5Ü ×1Ñ1Ü×'Ñ'Ü ×0Ñ0Ü—K‘KÜ ×+Ñ+Ü%×1Ñ1ÜŸ™Ü—m‘mò]/
ˆô` " $¨Ó1ˆ�r1   rJ   c               óL  — |xs t         }|xs i } |d| j                  j                  | j                  j                  t	        j
                  | j                  j                  «      dœ|¤Ž}| j                  j                  r| j                  |«       y | j                  |«       y )N)Ú	oauth_urlÚ
reddit_urlrH   r;   )
r   rM   rù   rú   r   rS   rH   rI   Ú_prepare_trusted_prawcoreÚ_prepare_untrusted_prawcore)r-   rA   rB   Ú	requestors       r/   rV   zReddit._prepare_prawcore1  s�   € ð *Ò6¬YˆØ+Ò1¨rÐá#ð 
Ø—k‘k×+Ñ+Ø—{‘{×-Ñ-Ü(×/Ñ/°·±×0FÑ0FÓGñ
ð ñ	
ˆ	ð �;‰;×$Ò$Ø×*Ñ*¨9Õ5à×,Ñ,¨YÕ7r1   c                óp  — | j                   j                  €J ‚t        | j                   j                  | j                   j                  | j                   j                  |¬«      }t        |¬«      }t        || j                   j                  ¬«      | _        | j                   j                  rz| j                   j                  rdt        || j                   j                  | j                   j                  ¬«      }t        || j                   j                  ¬«      x| _        | _        y | j                  |«       y )N)rG   rI   Úredirect_urirý   ©r­   r¯   )r­   ÚpasswordÚusername)rM   rI   r   rG   rÿ   r   r   r±   r4   r  r  r   r3   r8   r²   )r-   rý   r­   Úread_only_authorizerÚscript_authorizers        r/   rû   z Reddit._prepare_trusted_prawcoreF  sï   € à�{‰{×(Ñ(Ð4Ð4Ð4Ü,Ø—k‘k×+Ñ+ØŸ+™+×3Ñ3ØŸ™×1Ñ1Øô	
ˆô  2ÀÔNÐÜ&Ð2FÐTX×T_ÑT_×TkÑTkÔlˆÔà�;‰;×Ò D§K¡K×$8Ò$8Ü 0Ø+°d·k±k×6JÑ6JÐUY×U`ÑU`×UiÑUiô!Ðô 29Ø,¸$¿+¹+×:QÑ:Qô2ð ˆDŒJ˜Õ.ð ×+Ñ+¨MÕ:r1   c                óö   — t        | j                  j                  | j                  j                  |¬«      }t	        |¬«      }t        || j                  j                  ¬«      | _        | j                  |«       y )N)rG   rÿ   rý   r   r¯   )	r   rM   rG   rÿ   r   r   r±   r4   r²   )r-   rý   r­   r  s       r/   rü   z"Reddit._prepare_untrusted_prawcore\  s`   € Ü.Ø—k‘k×+Ñ+¸$¿+¹+×:RÑ:RÐ^gô
ˆô  2ÀÔNÐÜ&Ð2FÐTX×T_ÑT_×TkÑTkÔlˆÔØ×'Ñ'¨Õ6r1   c                ó0  — t        |«      j                  j                  d«      j                  d«      }d|v r	 | j	                  |«       |S |S # t
        $ r>}|j                  j                  }|€J ‚|j                  €J ‚|j                  cY d}~S d}~ww xY w)z/Return the canonical URL for a given share URL.ú/ÚsN)	r
   r¦   ÚrstripÚsplitÚgetr   ÚresponseÚnextÚurl)r-   r  ÚpartsÚeÚnext_requests        r/   Ú_resolve_share_urlzReddit._resolve_share_urld  s’   € ä˜“×"Ñ"×)Ñ)¨#Ó.×4Ñ4°SÓ9ˆØ�%‰<ð(Ø—‘˜”ð ˆ
ˆsˆ
øô ò (Ø Ÿz™zŸ™�Ø#Ð/Ð/Ð/Ø#×'Ñ'Ð3Ð3Ð3Ø#×'Ñ'Õ'ûð	(ús   ¹A Á	BÁ3BÂ
BÂB)r  c               óX   — |r| j                  |«      }t        j                  | ||¬«      S )aF  Return a lazy instance of :class:`.Comment`.

        :param id: The ID of the comment.
        :param url: A permalink pointing to the comment.

        .. note::

            If you want to obtain the comment's replies, you will need to call
            :meth:`~.Comment.refresh` on the returned :class:`.Comment`.

        ©Úidr  )r  r   rÛ   ©r-   r  r  s      r/   r´   zReddit.commentq  s*   € ñ Ø×)Ñ)¨#Ó.ˆCÜ�~‰~˜d r¨sÔ3Ð3r1   )r¡   r£   r¥   c               ó.   — | j                  ||d||¬«      S )a)  Return parsed objects returned from a DELETE request to ``path``.

        :param path: The path to fetch.
        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.
        :param params: The query parameters to add to the request (default: ``None``).

        ÚDELETE©r¡   r£   r¤   r¥   r¦   ©r«   ©r-   r¦   r¡   r£   r¥   s        r/   ÚdeletezReddit.delete�  s"   € ð& ×&Ñ&¨D°tÀHÐU[ÐbfÐ&ÓgÐgr1   c                ó.   — t        j                  | |«      S )z~Return an instance of :class:`.DomainListing`.

        :param domain: The domain to obtain submission listings for.

        )r   ÚDomainListing)r-   Údomains     r/   r  zReddit.domain–  s   € ô ×#Ñ# D¨&Ó1Ð1r1   ©r¥   c               ó*   — | j                  d||¬«      S )zÈReturn parsed objects returned from a GET request to ``path``.

        :param path: The path to fetch.
        :param params: The query parameters to add to the request (default: ``None``).

        ÚGET©r¤   r¥   r¦   r  )r-   r¦   r¥   s      r/   r  z
Reddit.getž  s   € ð ×&Ñ&¨e¸FÈÐ&ÓNÐNr1   )Ú	fullnamesrl   r  c               ó  ‡ ‡	‡
— t        d„ |||fD «       «      }|dk7  rd}t        |«      ‚|duŠ
‰
r|n|}|�7t        |t        «      rd}t        |«      ‚‰
rdndŠ		 	 	 	 d
ˆ	ˆ
ˆ fd„} ||«      S 	 	 	 	 dˆ fd	„}|€J ‚ ||«      S )aT  Fetch information about each item in ``fullnames``, ``url``, or ``subreddits``.

        :param fullnames: A list of fullnames for comments, submissions, and/or
            subreddits.
        :param subreddits: A list of subreddit names or :class:`.Subreddit` objects to
            retrieve subreddits from.
        :param url: A url (as a string) to retrieve lists of link submissions from.

        :returns: A generator that yields found items in their relative order.

        Items that cannot be matched will not be generated. Requests will be issued in
        batches for each 100 fullnames.

        .. note::

            For comments that are retrieved via this method, if you want to obtain its
            replies, you will need to call :meth:`~.Comment.refresh` on the yielded
            :class:`.Comment`.

        .. note::

            When using the URL option, it is important to be aware that URLs are treated
            literally by Reddit's API. As such, the URLs ``"youtube.com"`` and
            ``"https://www.youtube.com"`` will provide a different set of submissions.

        c              3  ó&   K  — | ]	  }|€Œd–— Œ y ­wr*   r;   )Ú.0r.   s     r/   ú	<genexpr>zReddit.info.<locals>.<genexpr>Ñ  s   è ø€ ÒY˜eÀuÑGXœÑYùs   ‚Šr+   z<Either 'fullnames', 'url', or 'subreddits' must be provided.Nz8'fullnames' and 'subreddits' must be a non-str iterable.r  Úsr_namec              3  ó$  •K  — ‰rt        d„ | D «       «      n!t        | D �cg c]  }t        |«      ‘Œ c}«      }	 t        t        |d«      «      }|sy ‰dj	                  |«      i}‰j                  t        d   |¬«      E d {  –—†  ŒNc c}w 7 Œ
­w)Nc              3  ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Ústr)r'  r›   s     r/   r(  z6Reddit.info.<locals>.name_generator.<locals>.<genexpr>è  s   è ø€ Ò5 tœ˜TŸÑ5ùs   ‚éd   ú,Úinfor   )Úiterr-  Úlistr   Újoinr  r   )Únamesr›   ÚiterableÚchunkr¥   Úapi_parameter_nameÚis_using_fullnamesr-   s        €€€r/   Úname_generatorz#Reddit.info.<locals>.name_generatorà  s—   øè ø€ ñ :L”DÑ5¨uÔ5Ô5ÔQUÐmrÖVsÐeiÔWZÐ[_ÕW`ÒVsÓQtð ð Ü ¤¨°#Ó!6Ó7�EÙ ØØ4FÈÏÉÐQVËÐ3X�FØ#Ÿx™x¬°Ñ(8À˜xÓH×HÐHð ùò Wtð Iús   ƒB¡B	³ABÂBÂBc              3  ó^   •K  — d| i}‰j                  t        d   |¬«      E d {  –—†  y 7 Œ­w)Nr  r0  r   )r  r   )Ú_urlr¥   r-   s     €r/   Úurl_generatorz"Reddit.info.<locals>.url_generatoró  s-   øè ø€ ð -2°4¨=ˆFØ—x‘x¤¨Ñ 0¸�xÓ@×@Ò@ús   ƒ"-¥+¦-)r4  z Iterable[str | models.Subreddit]ÚreturnúLGenerator[models.Subreddit | models.Comment | models.Submission, None, None])r;  r-  r=  r>  )ÚsumÚ	TypeErrorÚ
isinstancer-  )r-   r$  rl   r  Ú	set_countr9   Úids_or_namesr9  r<  r7  r8  s   `        @@r/   r0  zReddit.info¬  sÈ   ú€ ôJ ÑY¨	°3¸
Ð'CÔYÓYˆ	Ø˜Š>ØPˆCÜ˜C“.Ð à&¨dÐ2ÐÙ$6‘y¸JˆàÐ#Ü˜,¬Ô,ØP�Ü “nÐ$á);¡ÀÐðIØ7ðIð÷Iñ" " ,Ó/Ð/ð	AØð	Að
õ	Að ˆÐˆÙ˜SÓ!Ð!r1   c               ó.   — | j                  ||d||¬«      S )a(  Return parsed objects returned from a PATCH request to ``path``.

        :param path: The path to fetch.
        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.
        :param params: The query parameters to add to the request (default: ``None``).

        ÚPATCHr  r  r  s        r/   ÚpatchzReddit.patch   s"   € ð& ×&Ñ&¨D°tÀGÐTZÐaeÐ&ÓfÐfr1   )r¡   r¢   r£   r¥   c          	     ód  — |€|xs i }i }|r?|j                  «       D ],  \  }}	 |j                  «       }	|j                  |	«       |	||<   Œ. d}
t        d«      D ]O  }|r2|r0|€J ‚|j                  «       D ]  \  }}	||   j                  |	«       Œ 	 | j                  |||d||¬«      c S  |
€J ‚|
‚# t        t        t
        f$ r Y Œªw xY w# t        $ r[}|}
| j                  |¬«      }|€Y d}~ ŒE|dk(  rdnd}t        j                  d	||«       t        j                  |«       Y d}~ŒÑd}~ww xY w)
aŠ  Return parsed objects returned from a POST request to ``path``.

        :param path: The path to fetch.
        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param files: Dictionary, filename to file (like) object mapping (default:
            ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.
        :param params: The query parameters to add to the request (default: ``None``).

        .. note::

            This method automatically retries after a rate limit response. Only seekable
            file objects are rewound between attempts; a non-seekable object may be
            transmitted incompletely if a retry occurs.

        Nr   ÚPOSTr    )rš   r+   Úsecondr�   z"Rate limit hit, sleeping for %d %s)r’   ÚtellÚseekÚAttributeErrorÚOSErrorÚ
ValueErrorÚranger«   r   rž   r�   ÚdebugÚtimeÚsleep)r-   r¦   r¡   r¢   r£   r¥   Úfile_positionsÚnameÚfileÚpositionÚlast_exceptionÚattemptrš   r�   Úsecond_strings                  r/   ÚpostzReddit.post  sp  € ð8 ˆ<Ø’:˜2ˆDà)+ˆÙØ#Ÿk™k›mò 0‘
��dðØ#Ÿy™y›{�HØ—I‘I˜hÔ'ð (0�˜tÒ$ð0ð 59ˆÜ˜Q“xò 	$ˆGÙ™>ØÐ(Ð(Ð(Ø&4×&:Ñ&:Ó&<ò /‘N�D˜(Ø˜$‘K×$Ñ$ XÕ.ð/ð$Ø×.Ñ.ØØØØ!Ø!Øð /ó ò ð	$ð, Ð)Ð)Ð)ØÐøô9 '¬´Ð<ò Ùðûô& &ò $Ø!*�Ø×1Ñ1¸IÐ1ÓF�Ø�?ÝØ,3°qªL¡¸i�Ü—‘ÐAÀ7ÈMÔZÜ—
‘
˜7×#Ñ#ûð$ús/   ¤!B1ÂCÂ1CÃCÃ	D/ÃD*Ã05D*Ä*D/)r¡   r£   c               ó,   — | j                  ||d|¬«      S )aÏ  Return parsed objects returned from a PUT request to ``path``.

        :param path: The path to fetch.
        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.

        ÚPUT)r¡   r£   r¤   r¦   r  )r-   r¦   r¡   r£   s       r/   Úputz
Reddit.putX  s   € ð" ×&Ñ&¨D°tÀEÐPTÐ&ÓUÐUr1   )Úfullnamec               ó2   — t        j                  | ||¬«      S )zýReturn a lazy instance of :class:`.Redditor`.

        :param name: The name of the redditor.
        :param fullname: The fullname of the redditor, starting with ``t2_``.

        Either ``name`` or ``fullname`` can be provided, but not both.

        )r^  rT  )r   rÝ   )r-   rT  r^  s      r/   rµ   zReddit.redditork  s   € ô �‰˜t¨h¸TÔBÐBr1   c          	     ól  — | j                   j                  r| j                  «        |r|rd}t        |«      ‚| j                  €J ‚	 | j                  j                  ||||||¬«      S # t        $ rÂ}	 |j                  j                  «       }	nA# t        $ r5 |j                  j                  rd|j                  j                  i}	n|d‚Y nw xY wt        |	«      ddhk(  r‚ |	j                  d«      }
d|	v rt        |	d   «      d	k(  sJ ‚|	d   d
   }nd}t        t        d|	d   |
|g«      «      |‚d}~ww xY w)aø  Return the parsed JSON data returned from a request to URL.

        :param data: Dictionary, bytes, or file-like object to send in the body of the
            request (default: ``None``).
        :param files: Dictionary, filename to file (like) object mapping (default:
            ``None``).
        :param json: JSON-serializable object to send in the body of the request with a
            Content-Type header of application/json (default: ``None``). If ``json`` is
            provided, ``data`` should not be.
        :param method: The HTTP method (e.g., ``"GET"``, ``"POST"``, ``"PUT"``,
            ``"DELETE"``).
        :param params: The query parameters to add to the request (default: ``None``).
        :param path: The path to fetch.

        z-At most one of 'data' or 'json' is supported.Nr    ÚreasonÚerrorrP   ÚexplanationÚfieldsr+   r   z'list[RedditErrorItem | list[str] | str])rM   rz   r„   r   r3   rª   r   r  r£   rN  ÚtextÚsetr  Úlenr   r	   )r-   r¡   r¢   r£   r¤   r¥   r¦   r9   rš   Ú
error_datarc  Úfields               r/   rª   zReddit.requestv  se  € ð2 �;‰;×&Ò&Ø×!Ñ!Ô#Ù‘DØAˆCÜ! #Ó&Ð&Ø�z‰zÐ%Ð%Ð%ð	Ø—:‘:×%Ñ%ØØØØØØð &ó ð øô ò 	ð.Ø&×/Ñ/×4Ñ4Ó6‘
øÜò .Ø×%Ñ%×*Ò*Ø"*¨I×,>Ñ,>×,CÑ,CÐ!D‘Jà#¨Ð-ñ ð.úô
 �:‹ 7¨IÐ"6Ò6ØØ$Ÿ.™.¨Ó7ˆKØ˜:Ñ%Ü˜: hÑ/Ó0°AÒ5Ð5Ð5Ø" 8Ñ,¨QÑ/‘à�Ü$ÜØ=Ø Ñ)¨;¸Ð>óóð
 ðûð#	ús7   Á A( Á(	D3Á2BÂD.Â;CÃD.Ã
CÃA#D.Ä.D3c               óX   — |r| j                  |«      }t        j                  | ||¬«      S )a	  Return a lazy instance of :class:`.Submission`.

        :param id: A Reddit base36 submission ID, e.g., ``"2gmzqe"``.
        :param url: A URL supported by :meth:`.Submission.id_from_url`.

        Either ``id`` or ``url`` can be provided, but not both.

        r  )r  r   rÞ   r  s      r/   r¶   zReddit.submission¶  s,   € ñ Ø×)Ñ)¨#Ó.ˆCÜ× Ñ  ¨"°#Ô6Ð6r1   c                ó<   — | j                  dd|it        d   ¬«      S )zÎCheck to see if the username is available.

        For example, to check if the username ``bboe`` is available, try:

        .. code-block:: python

            reddit.username_available("bboe")

        r"  rn   Úusername_availabler#  )r«   r   )r-   rT  s     r/   rl  zReddit.username_availableÃ  s'   € ð ×&Ñ&¨e¸VÀT¸NÔQYÐZnÑQoÐ&ÓpÐpr1   )r=  r–   )r=  Úbool)r.   rm  r=  ÚNone)r=  r!   )r>   Úobjectr=  rn  r,  )ro   ú
str | Noner@   rp  rA   ú)type[prawcore.requestor.Requestor] | NonerB   údict[str, Any] | Nonerp   zstr | bool | int | Noner=  rn  )r=  rn  )rš   r   r=  zint | float | None)r¡   ú(dict[str, Any] | bytes | IO | str | Noner¢   údict[str, IO] | Noner£   ú!dict[Any, Any] | list[Any] | Noner¤   r-  r¥   údict[str, str | int] | Noner¦   r-  r=  r   )r­   zprawcore.auth.BaseAuthenticatorr=  rn  )rA   rq  rB   rr  r=  rn  )rý   zprawcore.requestor.Requestorr=  rn  )r  r-  r=  r-  )r  rp  r  rp  r=  zmodels.Comment)
r¦   r-  r¡   rs  r£   ru  r¥   rv  r=  r   )r  r-  r=  zmodels.DomainListing)r¦   r-  r¥   rv  r=  r   )r$  zIterable[str] | Nonerl   z'Iterable[models.Subreddit | str] | Noner  rp  r=  r>  )r¦   r-  r¡   rs  r¢   rt  r£   ru  r¥   rv  r=  r   )r¦   r-  r¡   rs  r£   ru  r=  r   )rT  rp  r^  rp  r=  zmodels.Redditor)r  rp  r  rp  r=  zmodels.Submission)rT  r-  r=  rm  )%r}   Ú
__module__Ú__qualname__Ú__doc__ÚreÚcompiler”   r‰   Úpropertyr0   r6   Úsetterr<   r?   rv   r„   rT   rž   r«   r²   rU   rV   rû   rü   r  r´   r  r  r  r0  rF  rZ  r]  rµ   rª   r¶   rl  r;   r1   r/   r(   r(   G   sŒ  „ ñð& "�r—z‘zÐ"SÓTÐØ€Nàòó ðð
 ò2ó ð2ð ×Ñò/ó ð/óó0ð
 !%ðdð ,0ØEIØ26ñdàðdð )ð	dð
 Cðdð 0ðdð 3ðdð 
ódóL	ó,)óð$ :>Ø&*Ø26ØØ.2Øñ"
ð 7ð"
ð $ð	"
ð
 0ð"
ð ð"
ð ,ð"
ð ð"
ð 
ó"
óHqó12ðl FJØ26ñ	8ð Cð8ð 0ð	8ð
 
ó8ó*;ó,7óð4À$õ 4ð( :>Ø26Ø.2ñhàðhð 7ð	hð
 0ðhð ,ðhð 
óhó*2ð /3ñ	OàðOð ,ð	Oð
 
óOð" +/Ø>BØñR"ð (ðR"ð <ð	R"ð
 ðR"ð
óR"ðp :>Ø26Ø.2ñgàðgð 7ð	gð
 0ðgð ,ðgð 
ógð2 :>Ø&*Ø26Ø.2ñAàðAð 7ð	Að
 $ðAð 0ðAð ,ðAð 
óAðN :>Ø26ñVàðVð 7ð	Vð
 0ðVð 
óVð&	CÈ$õ 	Cð :>Ø&*Ø26à.2ñ>ð 7ð>ð $ð	>ð
 0ð>ð ð>ð ,ð>ð ð>ð 
ó>ð@7ÀTõ 7ô
qr1   r(   )Cry  Ú
__future__r   r~   r{   rN   rK   rz  rQ  Ú	itertoolsr   Úloggingr   Útypingr   r   r   r	   Úurllib.parser
   Úprawcorer   r   r   r   r   r   r   r   r   Úprawcore.exceptionsr   r&   r   Úpraw.configr   Ú
praw.constr   r   r   Úpraw.exceptionsr   r   r   Úpraw.objectorr   Úupdate_checkerr   rˆ   ÚImportErrorÚsysÚversion_infor!   Útyping_extensionsÚcollections.abcr"   r#   r$   Úprawcore.authÚprawcore.requestorr%   rÛ   rÝ   rÞ   rß   r�   r(   r;   r1   r/   ú<module>r‘     sò   ðÙ å "ã Û Û Û 	Û 	Û Ý Ý ß /Ó /Ý !÷
÷ 
õ 
õ +å Ý ß ?Ñ ?÷ñ õ
 #ð"Ý+à"Ðñ
 Ûà
×Ñ˜7Ò"Þå*ç=Ñ=ãÛå/ð �.‰.€Ø�?‰?€Ø×Ñ€
Ø×Ñ€	á	�6Ó	€÷Fqò Fqøð9 ò "Ø€LØ!Òð"ús   ÂD Ä	DÄD