Ë
    …jÐj/Œ  ã                   óØ  — d 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mZ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l0m1Z1 d	dl2m3Z3 	 ddl4m5Z5 dZ6erddl8Z8e#jr                  Z9e#jt                  Z:e#jv                  Z;e#jx                  Z< e	d«      Z= G d„ d«      Z>y# e7$ r dZ6Y ŒRw xY w)zProvide the Reddit class.é    N)Úislice)Ú	getLogger)	ÚIOÚTYPE_CHECKINGÚAnyÚDictÚ	GeneratorÚIterableÚOptionalÚTypeÚUnion)Úwarn)	Ú
AuthorizerÚDeviceIDAuthorizerÚReadOnlyAuthorizerÚRedirectÚ	RequestorÚScriptAuthorizerÚTrustedAuthenticatorÚUntrustedAuthenticatorÚsession)Ú
BadRequesté   )Úmodels)ÚConfig)ÚAPI_PATHÚUSER_AGENT_FORMATÚ__version__)ÚClientExceptionÚ!MissingRequiredAttributeExceptionÚRedditAPIException)ÚObjector)Ú_deprecate_args)ÚBaseTokenManager)Úupdate_checkFTÚprawc                   ó  — e Zd ZdZdZ ej                  d«      Zede	fd„«       Z
edefd„«       Zej                  deddfd	„«       Zedefd
„«       Zej                  defd„«       Zd„ Zd„ Z eddddd«      	 dKdddddœdee   dee   deee      deeeef      dee   deeeee	f      fd„«       Zd„ Zd„ Zdedeee	ef      fd„Zdddddddœdeeeeeeef   f   e e!ef      deeee!f      deeeef      d ed!eeeeeef   f      d"edefd#„Z"d$„ Z#d%„ Z$ddd&œd'„Z%d(„ Z&d)„ Z' ed*d+«      	 dKdd,œd*ee   d+ee   fd-„«       Z( ed"ddd!«      dddd.œd"edeeeeeeef   f   e e!ef      deeeef      d!eeeeeef   f      def
d/„«       Z)d0efd1„Z* ed"d!«      dd2œd"ed!eeeeeeee	f   f   f      fd3„«       Z+ ed4d+d5«      dddd6œd4ee,e      d5ee,ed7ef         d+ee   de-ed8   ddf   fd9„«       Z. ed"dd«      ddd:œd"edeeeeeeef   f   e e!ef      deeeef      defd;„«       Z/ ed"ddd!d«      ddddd<œd"edeeeeeeef   f   e e!ef      deeee!f      deeeef      d!eeeeeef   f      defd=„«       Z0 ed"dd«      ddd:œd"edeeeeeeef   f   e e!ef      deeeef      fd>„«       Z1 ed?«      dd@œd?edd7fdA„«       Z2 edBdC«      	 dKddDœdBee   dCee   ddEfdF„«       Z3 ed d"d!ddd«      ddddd<œdeeeeeeef   f   e e!ef      deeee!f      deeeef      d ed!eeeeeeee	f   f   f      d"edefdG„«       Z4 ed*d+«      	 dKdd,œd*ee   d+ee   ddHfdI„«       Z5dBedefdJ„Z6y)LÚ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",
        )

    Fz.([0-9]{1,3}) (milliseconds?|seconds?|minutes?)Úreturnc                 óH   — | j                   }| xj                   dz  c_         |S )Nr   )Ú_unique_counter©ÚselfÚvalues     ú…/var/labsstorage/home/Thilakkumar/htdocs/soical-media-automation/automation_platform/venv/lib/python3.12/site-packages/praw/reddit.pyÚ_next_uniquezReddit._next_uniqueX   s#   € à×$Ñ$ˆØ×Ò Ñ!ÕØˆó    c                 ó4   — | j                   | j                  k(  S )z6Return ``True`` when using the ``ReadOnlyAuthorizer``.)Ú_coreÚ_read_only_core©r-   s    r/   Ú	read_onlyzReddit.read_only^   s   € ð �z‰z˜T×1Ñ1Ñ1Ð1r1   r.   Nc                 ó|   — |r| j                   | _        y| j                  €t        d«      ‚| 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,   s     r/   r6   zReddit.read_onlyc   s?   € ñ Ø×-Ñ-ˆD�JØ×"Ñ"Ð*Ü!ØXóð ð ×.Ñ.ˆD�Jr1   c                 óJ   — | j                   }|du rt        dt        d¬«       |S )zïGet validate_on_submit.

        .. deprecated:: 7.0

            If property :attr:`.validate_on_submit` is set to ``False``, the behavior is
            deprecated by Reddit. This attribute will be removed around May-June 2020.

        Fz›Reddit will check for validation on all posts around May-June 2020. It is recommended to check for validation by setting reddit.validate_on_submit to True.é   ©ÚcategoryÚ
stacklevel)Ú_validate_on_submitr   ÚDeprecationWarningr,   s     r/   Úvalidate_on_submitzReddit.validate_on_submitt   s2   € ð ×(Ñ(ˆØ�E‰>Üð6ô ,Øõð ˆr1   Úvalc                 ó   — || _         y ©N)r>   )r-   rA   s     r/   r@   zReddit.validate_on_submit‰   s
   € à#&ˆÕ r1   c                 ó   — | S )z Handle the context manager open.© r5   s    r/   Ú	__enter__zReddit.__enter__�   s   € àˆr1   c                  ó   — y)z!Handle the context manager close.NrE   )r-   Ú_argss     r/   Ú__exit__zReddit.__exit__‘   s   � r1   Ú	site_nameÚconfig_interpolationÚrequestor_classÚrequestor_kwargsÚtoken_manager)rK   rL   rM   rN   Úconfig_settingsc                ó0  — dx| _         x| _        | _        d| _        || _        d| _        d| _        	 |xs t        j                  d«      xs d}t        ||fi |¤Ž| _
        d}
d	D ]J  }t        | j                  |«      | j                  j                  dfv sŒ2t!        |
j#                  |«      «      ‚ | j                  j$                  | j                  j                  u rt!        |
j#                  d
«      › d�«      ‚| j'                  «        | j)                  «        | j+                  ||¬«       t-        j.                  | d«      | _        	 t-        j2                  | d«      | _        	 t-        j6                  | «      | _        	 t-        j:                  | d«      | _        	 t-        j>                  | d«      | _         	 t-        jB                  | d«      | _"        	 t-        jF                  | «      | _$        	 t-        jJ                  | d«      | _&        	 t-        jN                  | d«      | _(        	 t-        jR                  | d«      | _*        	 t-        jV                  | «      | _,        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``).
        :param token_manager: When provided, the passed instance, a subclass of
            :class:`.BaseTokenManager`, will manage tokens via two callback functions.
            This parameter must be provided in order to work with refresh tokens
            (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://2.python-requests.org/en/master/api/#requests.Session

        .. code-block:: python

            import json

            import betamax
            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 = betamax.Betamax(requests.Session())
            reddit = Reddit(
                ..., requestor_class=JSONDebugRequestor, requestor_kwargs={"session": my_session}
            )

        Nr   FÚ	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.©rL   rM   )-r3   r8   r4   Ú	_objectorÚ_token_managerr+   r>   ÚosÚgetenvr   ÚconfigÚconfigparserÚNoSectionErrorÚmessageÚgetattrÚCONFIG_NOT_SETr    ÚformatrV   Ú_check_for_updateÚ_prepare_objectorÚ_prepare_prawcorer   ÚAuthÚauthÚDraftHelperÚdraftsÚFrontÚfrontÚInboxÚinboxÚ
LiveHelperÚliveÚMultiredditHelperÚmultiredditÚRedditModNotesÚnotesÚ	RedditorsÚ	redditorsÚSubredditHelperÚ	subredditÚ
SubredditsÚ
subredditsÚUserÚuser)r-   rJ   rK   rL   rM   rN   rO   Úconfig_sectionÚexcÚhelp_messageÚrequired_messageÚ	attributes               r/   Ú__init__zReddit.__init__”   s¥  € ð` EIÐHˆŒ
ÐH�TÔ*¨TÔ-AØˆŒØ+ˆÔØ ˆÔØ#(ˆÔ ð	Ø&ÒM¬"¯)©)°KÓ*@ÒMÀIˆNÜ ØÐ 4ñØ8GñˆDŒKð ;ð 	ð
 5ò 	ˆIÜ�t—{‘{ IÓ.°4·;±;×3MÑ3MÈtÐ2TÒTÜ7Ø$×+Ñ+¨IÓ6óð ð	ð
 �;‰;×$Ñ$¨¯©×(BÑ(BÑBÜ3Ø#×*Ñ*¨?Ó;Ð<ð =4ð 4óð ð 	×ÑÔ Ø×ÑÔ Ø×ÑØ+Ð>Nð 	ô 	
ô —K‘K  dÓ+ˆŒ	ð	ô ×(Ñ(¨¨tÓ4ˆŒð	ô$ —\‘\ $Ó'ˆŒ
ð		ô —\‘\ $¨Ó-ˆŒ
ð	ô ×%Ñ% d¨DÓ1ˆŒ	ð		ô "×3Ñ3°D¸$Ó?ˆÔð		ô ×*Ñ*¨4Ó0ˆŒ
ð	ô0  ×)Ñ)¨$°Ó5ˆŒð
	ô  ×/Ñ/°°dÓ;ˆŒð	ô2 !×+Ñ+¨D°$Ó7ˆŒð
	ô —K‘K Ó%ˆŒ	ð		øôC ×*Ñ*ò 
	ðcð ð Ð$Ø—’  L >Ð2Ñ2•Øûð
	ús   ³/I  É JÉ3JÊJc                 ó  — | j                   j                  rX	 t        «       j                  j                  }|dk(  ry 	 d}	 t        j                  «        d}|rt        j                  d«       y y y # t
        $ r Y Œ>w xY w# t        $ r Y Œ4w xY w)NÚ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.
)r\   Úcheck_for_asyncÚget_ipythonÚ	__class__Ú__name__Ú	NameErrorÚasyncioÚget_running_loopÚ	ExceptionÚloggerÚwarning)r-   ÚshellÚin_asyncs      r/   Ú_check_for_asynczReddit._check_for_async»  sœ   € Ø�;‰;×&Ò&ðÜ#›×/Ñ/×8Ñ8�ØÐ1Ò1Øð 2ð ˆHðÜ×(Ñ(Ô*Ø�ñ Ü—‘ð(õð ð 'øô
 ò Ùðûô ò Ùðús#   ˜#A0 Á A? Á0	A<Á;A<Á?	BÂ
Bc                 ó    — t         ry t        j                  s7| j                  j                  r t        t        t        «       dt        _        y y y )NT)ÚUPDATE_CHECKER_MISSINGr(   Úupdate_checkedr\   Úcheck_for_updatesr%   Ú__package__r   r5   s    r/   rc   zReddit._check_for_updateÒ  s8   € Ý!ØÜ×$Ò$¨¯©×)FÒ)FÜœ¤kÔ2Ø$(ŒFÕ!ð *GÐ$r1   Ú	exceptionc                 ó²  — |j                   D ]È  }|j                  dk(  sŒ| 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_typeÚ_ratelimit_regexÚsearchr_   ÚintÚgroupÚ
startswithr\   Úratelimit_seconds)r-   r–   ÚitemÚamount_searchÚsecondsÚsleep_secondss         r/   Ú_handle_rate_limitzReddit._handle_rate_limitÙ  sÊ   € ð —O‘Oò 	)ˆDØ�‰ +Ó-Ø $× 5Ñ 5× <Ñ <¸T¿\¹\Ó J�Ù$Øð ô ˜m×1Ñ1°!Ó4Ó5�Ø ×&Ñ& qÓ)×4Ñ4°XÔ>Ø˜r‘M‘GØ"×(Ñ(¨Ó+×6Ñ6°}ÔEØ�GØœc $§+¡+×"?Ñ"?Ó@Ó@Ø$+¨a¡K�MØ(Ò(ð	)ð r1   Ú ©ÚdataÚfilesÚjsonÚmethodÚparamsÚpathr¬   r­   r®   r¯   r°   r±   c          
      ób   — | 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«   )rX   Ú	objectifyÚrequest)r-   r¬   r­   r®   r¯   r°   r±   s          r/   Ú_objectify_requestzReddit._objectify_requestë  s>   € ð2 �~‰~×'Ñ'Ø�L‰LØØØØØØð ó ó	
ð 		
r1   c                 óÔ  — | j                   �{t        dt        d¬«       | j                  j                  rt        d«      ‚| | j                   _        t        || j                   j                  | j                   j                  ¬«      }nJ| j                  j                  r"t        || j                  j                  ¬«      }n| j                  | _        y t        |«      x| _        | _        y )NzÃToken managers have been deprecated and will be removed in the near future. See https://www.reddit.com/r/redditdev/comments/olk5e6/followup_oauth2_api_changes_regarding_refresh/ for more details.r™   r;   zI'refresh_token' setting cannot be provided when providing 'token_manager')Úpost_refresh_callbackÚpre_refresh_callback)Úrefresh_token)rY   r   r?   r\   r¹   Ú	TypeErrorÚredditr   r·   r¸   r4   r3   r   r8   )r-   ÚauthenticatorÚ
authorizers      r/   Ú_prepare_common_authorizerz!Reddit._prepare_common_authorizer  sÎ   € Ø×ÑÐ*ÜðSô ,Øõð �{‰{×(Ò(Üð'óð ð
 *.ˆD×ÑÔ&Ü#ØØ&*×&9Ñ&9×&OÑ&OØ%)×%8Ñ%8×%MÑ%Mô‰Jð
 �[‰[×&Ò&Ü#Ø¨T¯[©[×-FÑ-Fô‰Jð ×-Ñ-ˆDŒJØÜ-4°ZÓ-@Ð@ˆŒ
�TÕ*r1   c                 óÚ  — 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        jB                  “d t        jD                  “d!t        jF                  “d"t        jH                  “¥t        jJ                  t        jL                  t        jN                  t        jP                  t        jR                  t        jT                  t        jV                  t        jX                  t        jZ                  d#œ	¥}t]        | |«      | _/        y )$NÚcommentr_   ÚredditorÚ
submissionrw   ÚtrophyÚButtonÚ
CollectionÚDraftÚ	DraftListÚImageÚLabeledMultiÚListingÚ
LiveUpdateÚLiveUpdateEventÚMenuLinkÚModeratedListÚModmailActionÚModmailConversationzModmailConversations-listÚModmailMessageÚSubmenuÚ
TrophyListÚUserListÚUserSubredditÚbuttonÚcalendarzcommunity-listÚcustomzid-cardÚimageÚmenuÚ	modactionzmoderator-list)	Ú
moderatorsÚmod_noteÚmorez
post-flairÚruleÚ
stylesheetzsubreddit-rulesÚtextareaÚwidget)0r\   Úkindsr   ÚCommentÚMessageÚRedditorÚ
SubmissionÚ	SubredditÚTrophyrÄ   rÅ   rÆ   rÇ   rÈ   ÚMultiredditrÊ   rË   Ú
LiveThreadrÍ   rÎ   rÏ   rÐ   ÚModmailConversationsListingrÑ   rÒ   rÓ   ÚRedditorListrÕ   ÚButtonWidgetÚCalendarÚCommunityListÚCustomWidgetÚIDCardÚImageWidgetÚMenuÚ	ModActionÚModeratorListingÚModeratorsWidgetÚModNoteÚMoreCommentsÚPostFlairWidgetÚRuleÚ
StylesheetÚRulesWidgetÚTextAreaÚWidgetr"   rX   )r-   Úmappingss     r/   rd   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—m‘mð,
ð œ&×+Ñ+ð,
ð ”V—\‘\ð,
ð œ×)Ñ)ð,
ð ”V—\‘\ð,
ð œF×.Ñ.ð,
ð ”v—~‘~ð,
ð œ&×+Ñ+ð,
ð œv×0Ñ0ð,
ð  œŸ™ð!,
ð" œV×1Ñ1ñ#,
ð$ œV×1Ñ1ð%,
ð& "¤6×#=Ñ#=ð',
ð( (¬×)KÑ)Kð),
ð* œf×3Ñ3ð+,
ð, ”v—~‘~ð-,
ð. œ&×+Ñ+ð/,
ð0 œ×+Ñ+ð1,
ð2 œV×1Ñ1ð3,
ð4 ”f×)Ñ)ð5,
ð6 œŸ™ð7,
ð8 œf×2Ñ2ð9,
ð: ”f×)Ñ)ð;,
ð< ”v—}‘}ð=,
ð> ”V×'Ñ'ð?,
ð@ ”F—K‘KðA,
ðB œ×)Ñ)ðC,
ðD œf×5Ñ5ñE,
ôF !×1Ñ1ÜŸ™Ü×'Ñ'Ü ×0Ñ0Ü—K‘KÜ ×+Ñ+Ü%×1Ñ1ÜŸ™Ü—m‘mòW,
ˆôZ " $¨Ó1ˆ�r1   rW   c                óJ  — |xs t         }|xs i } |t        j                  | j                  j                  «      | j                  j
                  | j                  j                  fi |¤Ž}| j                  j                  r| j                  |«       y | j                  |«       y rC   )
r   r   rb   r\   rU   Ú	oauth_urlÚ
reddit_urlrV   Ú_prepare_trusted_prawcoreÚ_prepare_untrusted_prawcore)r-   rL   rM   Ú	requestors       r/   re   zReddit._prepare_prawcore]  sˆ   € Ø)Ò6¬YˆØ+Ò1¨rÐá#Ü×$Ñ$ T§[¡[×%;Ñ%;Ó<Ø�K‰K×!Ñ!Ø�K‰K×"Ñ"ñ
ð ñ	
ˆ	ð �;‰;×$Ò$Ø×*Ñ*¨9Õ5à×,Ñ,¨YÕ7r1   c                 óâ  — t        || j                  j                  | j                  j                  | j                  j                  «      }t        |«      }t        |«      | _        | j                  j                  rc| j                  j                  rMt        || j                  j                  | j                  j                  «      }t        |«      x| _        | _        y | j                  |«       y rC   )r   r\   rT   rV   Úredirect_urir   r   r4   ÚusernameÚpasswordr   r3   r8   r¾   )r-   r  r¼   Úread_only_authorizerÚscript_authorizers        r/   r  z Reddit._prepare_trusted_prawcorem  sµ   € Ü,ØØ�K‰K×!Ñ!Ø�K‰K×%Ñ%Ø�K‰K×$Ñ$ó	
ˆô  2°-Ó@ÐÜ&Ð';Ó<ˆÔà�;‰;×Ò D§K¡K×$8Ò$8Ü 0Ø˜tŸ{™{×3Ñ3°T·[±[×5IÑ5Ió!Ðô 29Ð9JÓ1KÐKˆDŒJ˜Õ.à×+Ñ+¨MÕ:r1   c                 óÆ   — t        || j                  j                  | j                  j                  «      }t	        |«      }t        |«      | _        | j                  |«       y rC   )r   r\   rT   r  r   r   r4   r¾   )r-   r  r¼   r  s       r/   r  z"Reddit._prepare_untrusted_prawcore  sP   € Ü.Ø�t—{‘{×,Ñ,¨d¯k©k×.FÑ.Fó
ˆô  2°-Ó@ÐÜ&Ð';Ó<ˆÔØ×'Ñ'¨Õ6r1   ÚidÚurl)r  c                ó2   — 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`.

        ©r  r  )r   rä   ©r-   r  r  s      r/   rÀ   zReddit.comment‡  s   € ô$ �~‰~˜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ð 'ó 
ð 	
r1   Údomainc                 ó.   — t        j                  | |«      S )z~Return an instance of :class:`.DomainListing`.

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

        )r   ÚDomainListing)r-   r  s     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/   Úgetz
Reddit.get»  s   € ð ×&Ñ&¨e¸FÈÐ&ÓNÐNr1   Ú	fullnamesry   )r  ry   r  úpraw.models.Subreddit)r   zpraw.models.Commentúpraw.models.Submissionc                óâ   ‡ ‡‡— |||fj                  d«      }|dk7  rt        d«      ‚|duŠ‰r|n|}|�0t        |t        «      rt        d«      ‚‰rdndŠˆˆˆ fd„} ||«      S ˆ fd„} ||«      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.

        Nr™   z<Either 'fullnames', 'url', or 'subreddits' must be provided.z8'fullnames' and 'subreddits' must be a non-str iterable.r  Úsr_namec              3   ó  •K  — ‰rt        | «      }n"t        | D �cg c]  }t        |«      ‘Œ c}«      }	 t        t        |d«      «      }|sy ‰dj	                  |«      i}‰j                  t        d   |¬«      D ]  }|–— Œ ŒOc c}w ­w)Néd   ú,Úinfor  )ÚiterÚstrÚlistr   Újoinr  r   )	ÚnamesÚiterabler¥   Úchunkr°   ÚresultÚapi_parameter_nameÚis_using_fullnamesr-   s	         €€€r/   Ú	generatorzReddit.info.<locals>.generator  s‰   øè ø€ Ù%Ü# E›{‘Hä#¸5Ö$A°4¤S¨¥YÒ$AÓB�HØÜ ¤¨°#Ó!6Ó7�EÙ ØØ0°#·(±(¸5³/ÐB�FØ"&§(¡(¬8°FÑ+;ÀF (Ó"Kò %˜Ø$›ð%ð ùò %Bùs   ƒB	›B­AB	c              3   ó\   •K  — d| i}‰j                  t        d   |¬«      D ]  }|–— Œ y ­w)Nr  r'  r  )r  r   )r  r°   r/  r-   s      €r/   r2  zReddit.info.<locals>.generator  s6   øè ø€ Ø˜S�\ˆFØŸ(™(¤8¨FÑ#3¸F˜(ÓCò �Ø“ñùs   ƒ),)Úcountrº   Ú
isinstancer)  )	r-   r  ry   r  Ú
none_countÚids_or_namesr2  r0  r1  s	   `      @@r/   r'  zReddit.infoÊ  s™   ú€ ðL    jÐ1×7Ñ7¸Ó=ˆ
Ø˜Š?ÜØNóð ð '¨dÐ2ÐÙ$6‘y¸JˆàÐ#Ü˜,¬Ô,ÜØNóð ñ *<¡ÀÐö%ñ ˜\Ó*Ð*ô	ñ
 ˜‹~Ðr1   )r¬   r®   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.

        ÚPATCH©r¬   r®   r¯   r±   r  ©r-   r±   r¬   r®   s       r/   ÚpatchzReddit.patch  s   € ð$ ×&Ñ&¨D°tÀGÐRVÐ&ÓWÐWr1   )r¬   r­   r®   r°   c                óF  — |€|xs i }d}d}|dkD  r|dz  }	 | j                  |||d||¬«      S |‚# t        $ r_}|}| j                  |¬«      }	|	€Y d}~|‚|	dk(  rdnd	}
t        j	                  d
|	› d|
› �«       t        j                  |	«       Y d}~nd}~ww xY w|dkD  rŒ�Œt)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``).

        Nr:   r   r   ÚPOSTr«   )r–   Úsecondr§   zRate limit hit, sleeping for ú )rµ   r!   r©   rŒ   ÚdebugÚtimeÚsleep)r-   r±   r¬   r­   r®   r°   ÚattemptsÚlast_exceptionr–   r§   Úsecond_strings              r/   ÚpostzReddit.post+  sß   € ð. ˆ<Ø’:˜2ˆDàˆØˆØ˜ŠlØ˜‰MˆHð$Ø×.Ñ.ØØØØ!Ø!Øð /ó ð ð  Ðøô &ò $Ø!*�Ø×1Ñ1¸IÐ1ÓF�Ø�?Ûð Ðð -4°qªL¡¸i�Ü—‘Ð<¸W¸IÀQÀ}ÀoÐVÔWÜ—
‘
˜7×#Ñ#ûð$úð ˜‹løs   ˜1 ±	BºBÁ9BÂB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.

        ÚPUTr:  r  r;  s       r/   Úputz
Reddit.put\  s   € ð$ ×&Ñ&¨D°tÀEÐPTÐ&ÓUÐUr1   Únsfw)rK  c                ó  — t         d   j                  |rdnd¬«      }d}	 | j                  |d| j                  i¬«       t        j                  | |j                  d«      d	   «      S # t        $ r}|j
                  }Y d}~ŒBd}~ww xY w)
zªReturn a random lazy instance of :class:`.Subreddit`.

        :param nsfw: Return a random NSFW (not safe for work) subreddit (default:
            ``False``).

        rw   ÚrandnsfwÚrandom)rw   NÚuniquer  ú/r™   )	r   rb   r  r0   r   r±   r   rè   Úsplit)r-   rK  r  r±   Úredirects        r/   Úrandom_subredditzReddit.random_subredditp  s‚   € ô �{Ñ#×*Ñ*Á4±ZÈXÐ*ÓVˆØˆð	!Ø�H‰H�S (¨D×,=Ñ,=Ð!>ˆHÔ?ô ×Ñ  d§j¡j°£o°aÑ&8Ó9Ð9øô ò 	!Ø—=‘=�Dûð	!ús   ¡A( Á(	BÁ1BÂBÚnameÚfullname)rU  zpraw.models.Redditorc                ó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.

        )rT  rU  )r   ræ   )r-   rT  rU  s      r/   rÁ   zReddit.redditor€  s   € ô �‰˜t¨$¸ÔBÐBr1   c                ó6  — | j                   j                  r| j                  «        |r|rt        d«      ‚	 | j                  j                  ||||||¬«      S # t        $ r·}	 |j                  j                  «       }n@# t        $ r4 |j                  j                  rd|j                  j                  i}n|‚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        |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.r«   ÚreasonÚerrorr_   ÚexplanationÚfieldsr   r   N)r\   r„   r�   r   r3   r´   r   Úresponser®   Ú
ValueErrorÚtextÚsetr  Úlenr!   )
r-   r¬   r­   r®   r¯   r°   r±   r–   rZ  Úfields
             r/   r´   zReddit.requestŽ  s>  € ð4 �;‰;×&Ò&Ø×!Ñ!Ô#Ù‘DÜ!Ð"QÓRÐRð	Ø—:‘:×%Ñ%ØØØØØØð &ó ð øô ò 	ð$Ø ×)Ñ)×.Ñ.Ó0‘øÜò $Ø×%Ñ%×*Ò*Ø$ i×&8Ñ&8×&=Ñ&=Ð>‘Dà#�Oñ ð$úô
 �4‹y˜W iÐ0Ò0ØØŸ(™( =Ó1ˆKØ˜4ÑÜ˜4 ™>Ó*¨aÒ/Ð/Ð/Ø˜X™ qÑ)‘à�Ü$Ø�h‘ ¨eÐ4óàðûð!	ús6   · A Á	DÁ"A=Á<DÁ=:B:Â7DÂ9B:Â:ADÄDr!  c                ó2   — 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  s      r/   rÂ   zReddit.submissionÉ  s   € ô × Ñ  ¨"°#Ô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  r{   Úusername_availabler  )rµ   r   )r-   rT  s     r/   rd  zReddit.username_available×  s-   € ð ×&Ñ&Ø &¨$ ´hÐ?SÑ6Tð 'ó 
ð 	
r1   rC   )7r‡   Ú
__module__Ú__qualname__Ú__doc__r“   ÚreÚcompilerŸ   Úpropertyr¡   r0   Úboolr6   Úsetterr@   rF   rI   r#   r   r)  r   r   r   r   r$   r   r�   r�   rc   r!   Úfloatr©   Úbytesr   rµ   r¾   rd   re   r  r  rÀ   r  r  r  r
   r	   r'  r<  rG  rJ  rS  rÁ   r´   rÂ   rd  rE   r1   r/   r(   r(   A   sÎ  „ ñð& €NØ!�r—z‘zÐ"SÓTÐàð˜cò ó ðð
 ð2˜4ò 2ó ð2ð ×Ñð/˜tð /¨ò /ó ð/ð  ð Dò ó ðð( ×Ñð' dò 'ó ð'òò0ñ ØØØØØóð $(ð^ð /3Ø59Ø59Ø48ò^à˜C‘=ð^ð ' s™mð	^ð
 " $ y¡/Ñ2ð^ð # 4¨¨S¨¡>Ñ2ð^ð  Ð 0Ñ1ð^ð $ E¨#¨t°S¨.Ñ$9Ñ:ò^óð^ò@	ò.)ðØ+ðà	�%˜˜U˜
Ñ#Ñ	$óð* MQØ)-Ø)-ØØ7;Øò"
ð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð"
ð ˜˜S "˜W™Ñ&ð	"
ð
 �t˜C ˜H‘~Ñ&ð"
ð ð"
ð ˜˜s D¨¨c¨¡NÐ2Ñ3Ñ4ð"
ð ð"
ð 
ó"
òHAò<.2ð` 48È$ô 8ò ;ò$7ñ �T˜5Ó!ð !ð4ð "ò	4à�S‰Mð4ð �c‰]ò	4ó "ð4ñ& �V˜V V¨XÓ6ð
 MQØ)-Ø7;ò
àð
ð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð	
ð
 �t˜C ˜H‘~Ñ&ð
ð ˜˜s D¨¨c¨¡NÐ2Ñ3Ñ4ð
ð 
ò
ó 7ð
ð.2˜Só 2ñ �V˜XÓ&ð
 DHò	OàðOð ˜˜s D¨¨e°C¸°H©oÐ)=Ñ$>Ð>Ñ?Ñ@ò	Oó 'ðOñ �[ %¨Ó6ð .2ØNRØ!òJð ˜H S™MÑ*ðJð ˜X eÐ,CÀSÐ,HÑ&IÑJÑKð	Jð
 �c‰]ðJð 
ØÐVÑWØØð	ñ
òJó 7ðJñX �V˜V VÓ,ð
 MQØ)-òXàðXð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð	Xð
 �t˜C ˜H‘~Ñ&ðXð 
òXó -ðXñ& �V˜V W¨h¸Ó?ð
 MQØ)-Ø)-Ø7;ò.àð.ð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð	.ð
 ˜˜S "˜W™Ñ&ð.ð �t˜C ˜H‘~Ñ&ð.ð ˜˜s D¨¨c¨¡NÐ2Ñ3Ñ4ð.ð 
ò.ó @ð.ñ` �V˜V VÓ,ð
 MQØ)-òVàðVð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð	Vð
 �t˜C ˜H‘~Ñ&òVó -ðVñ& �VÓØ/4ò :¨ð :Ð9Pò :ó ð:ñ �V˜ZÓ(à$(ðCØGKòCØ˜S‘MðCØ7?À±}ðCà	òCó )ðCñ �X˜v x°¸À&ÓIð MQØ)-Ø)-àCGò8ð �u˜T # u¨S°#¨X¡Ð"6Ñ7¸ÀÀCÐGÑHÑIð8ð ˜˜S "˜W™Ñ&ð	8ð
 �t˜C ˜H‘~Ñ&ð8ð ð8ð ˜˜s D¨¨e°C¸°H©oÐ)=Ñ$>Ð>Ñ?Ñ@ð8ð ð8ð 
ò8ó Jð8ñt �T˜5Ó!à"&ð7Ø@Dò7Ø˜3‘-ð7Ø08¸±ð7à	!ò7ó "ð7ð
 sð 
¨tô 
r1   r(   )?rg  r‰   r]   rZ   rh  rB  Ú	itertoolsr   Úloggingr   Útypingr   r   r   r   r	   r
   r   r   r   Úwarningsr   Úprawcorer   r   r   r   r   r   r   r   r   Úprawcore.exceptionsr   rª   r   r\   r   Úconstr   r   r   Ú
exceptionsr   r    r!   Úobjectorr"   Úutilr#   Úutil.token_managerr$   Úupdate_checkerr%   r’   ÚImportErrorr&   rä   ræ   rç   rè   rŒ   r(   rE   r1   r/   ú<module>r|     sÑ   ðÙ Û Û Û 	Û 	Û Ý Ý ÷
÷ 
õ 
õ ÷
÷ 
õ 
õ +å Ý ß ;Ñ ;÷ñ õ
 Ý !Ý 0ð"Ý+à"Ðñ Ûà
�.‰.€Ø�?‰?€Ø×Ñ€
Ø×Ñ€	á	�6Ó	€÷b
ò b
øð ò "Ø!Òð"ús   ÂC ÃC)Ã(C)