
    i4Q                         S SK r S SKrS SKrS SKJr  S SKJrJrJrJrJ	r	  S SK
r
S SK
JrJrJrJrJr  S SKJr  S SKJr  \ R(                  " \5      r " S S5      rg)	    N)datetime)BinaryIOCallableListOptionalUnion)StopTransmissionenumsrawtypesutils)FilePartMissing)FileTypec            T       `   \ rS rSr                                     S5SSS\\\4   S\\\4   S\S	\S
   S\	S   S\
S\S\
S\S\S\S\S\\\4   S\\\4   S\S\
S\
S\S\S\S\
SSS\S \S!\
S"\
S#\S$\
S%\S&S'S(\S)   S*\S+\S,\S-\\\4   S.\S/\S0\	S   S1\S2\S3   4RS4 jjrSrg)6	SendVideo    N selfzpyrogram.Clientchat_idvideocaption
parse_modezenums.ParseModecaption_entitiesztypes.MessageEntityhas_spoilerttl_seconds	view_oncedurationwidthheightvideo_start_timestampvideo_coverthumb	file_namesupports_streamingdisable_notificationmessage_thread_iddirect_messages_topic_id	effect_idshow_caption_above_mediareply_parametersztypes.ReplyParametersschedule_daterepeat_periodprotect_contentno_soundbusiness_connection_idallow_paid_broadcastpaid_message_star_countsuggested_post_parametersztypes.SuggestedPostParametersreply_markup)ztypes.InlineKeyboardMarkupztypes.ReplyKeyboardMarkupztypes.ReplyKeyboardRemoveztypes.ForceReplyprogressprogress_argsreply_to_message_idreply_to_chat_idreply_to_story_id
quote_textquote_entitiesquote_offsetreturnztypes.Messagec(                 t  #    [        U"SLU#SLU$SLU%SLU&SLU'SL45      (       a  U"b  [        R                  S5        U#b  [        R                  S5        U$b  [        R                  S5        U%b  [        R                  S5        U&b  [        R                  S5        U'b  [        R                  S5        [        R                  " U"U#U$U%UU&U'S9nSn(Sn)Sn*U R                  U5      I Sh  vN n+ UGb'  [        U[        5      (       Ga>  [        R                  R                  U5      (       as  U R                  [        R                  R                  R                  U+[        R                  R!                  U R#                  U5      I Sh  vN S	9S
95      I Sh  vN n*GO[$        R&                  " SU5      (       a[  U R                  [        R                  R                  R                  U+[        R                  R)                  US9S
95      I Sh  vN n*O[*        R,                  " U[.        R0                  5      R2                  n)OqU R                  [        R                  R                  R                  U+[        R                  R!                  U R#                  U5      I Sh  vN S	9S
95      I Sh  vN n*U*(       a[  [        R                  R5                  U*R6                  R2                  U*R6                  R8                  U*R6                  R:                  S9n)[        U[        5      (       Ga  [        R                  R                  U5      (       a  U R#                  U5      I Sh  vN nU R#                  UU U!S9I Sh  vN n([        R                  R=                  U R?                  U5      =(       d    SU(U(       a  SOUUUU)UU[        R                  RA                  U=(       d    SU	U
US9[        R                  RC                  U=(       d    [        R                  RE                  U5      S9/S9	n,GOg[$        R&                  " SU5      (       a,  [        R                  RG                  UU(       a  SOUUU)US9n,GO[*        R,                  " U[.        RH                  U(       a  SOUUS9n,U)U,l%        UU,l&        OU R#                  U5      I Sh  vN nU R#                  UU U!S9I Sh  vN n([        R                  R=                  U R?                  U=(       d    URN                  5      =(       d    SU(U(       a  SOUUUU)UU[        R                  RA                  U=(       d    SU	U
US9[        R                  RC                  U=(       d    URN                  S9/S9	n,  U R                  [        R                  R                  RP                  " SU+U,U=(       d    SU[*        RR                  " U UUU5      I Sh  vN U RU                  5       [*        RV                  " U5      UUUU(       a  URY                  5       OSU(       a  URY                  U 5      I Sh  vN OSUS.[*        RZ                  " XXE5      I Sh  vN D6US9I Sh  vN n-[*        R\                  " U U-S9I Sh  vN n.U.(       a  U.S   $ S$  GN GN2 GN% GN GN! GN GNb GNL GN GN N N N^ NS N8! [^         a8  n/U R#                  UU(R2                  U/R`                  S9I Sh  vN     Sn/A/OSn/A/ff = fGM  ! [b         a     gf = f7f)a  Send video files.

.. note::

    Starting December 1, 2024 messages with video that are sent, copied or forwarded to groups and channels with a sufficiently large audience can be automatically scheduled by the server until the respective video is reencoded.
    Such messages will have ``scheduled`` property set and beware of using the correct message identifiers when using such :obj:`~pyrogram.types.Message` objects.

.. include:: /_includes/usable-by/users-bots.rst

Parameters:
    chat_id (``int`` | ``str``):
        Unique identifier (int) or username (str) of the target chat.
        For your personal cloud (Saved Messages) you can simply use "me" or "self".
        For a contact that exists in your Telegram address book you can use his phone number (str).

    video (``str`` | ``BinaryIO``):
        Video to send.
        Pass a file_id as string to send a video that exists on the Telegram servers,
        pass an HTTP URL as a string for Telegram to get a video from the Internet,
        pass a file path as string to upload a new video that exists on your local machine, or
        pass a binary file-like object with its attribute ".name" set for in-memory uploads.

    caption (``str``, *optional*):
        Video caption, 0-1024 characters.

    parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
        By default, texts are parsed using both Markdown and HTML styles.
        You can combine both syntaxes together.

    caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
        List of special entities that appear in the caption, which can be specified instead of *parse_mode*.

    has_spoiler (``bool``, *optional*):
        Pass True if the video needs to be covered with a spoiler animation.

    ttl_seconds (``int``, *optional*):
        Self-Destruct Timer.
        If you set a timer, the video will self-destruct in *ttl_seconds*
        seconds after it was viewed.

    view_once (``bool``, *optional*):
        Self-Destruct Timer.
        If True, the photo will self-destruct after it was viewed.

    duration (``int``, *optional*):
        Duration of sent video in seconds.

    width (``int``, *optional*):
        Video width.

    height (``int``, *optional*):
        Video height.

    video_start_timestamp (``int``, *optional*):
        Video startpoint, in seconds.

    video_cover (``str`` | ``BinaryIO``, *optional*):
        Video cover.
        Pass a file_id as string to attach a photo that exists on the Telegram servers,
        pass an HTTP URL as a string for Telegram to get a photo from the Internet,
        pass a file path as string to upload a new photo that exists on your local machine, or
        pass a binary file-like object with its attribute ".name" set for in-memory uploads.

    thumb (``str`` | ``BinaryIO``, *optional*):
        Thumbnail of the video sent.
        The thumbnail should be in JPEG format and less than 200 KB in size.
        A thumbnail's width and height should not exceed 320 pixels.
        Thumbnails can't be reused and can be only uploaded as a new file.

    file_name (``str``, *optional*):
        File name of the video sent.
        Defaults to file's path basename.

    supports_streaming (``bool``, *optional*):
        Pass True, if the uploaded video is suitable for streaming.
        Defaults to True.

    disable_notification (``bool``, *optional*):
        Sends the message silently.
        Users will receive a notification with no sound.

    message_thread_id (``int``, *optional*):
        Unique identifier for the target message thread (topic) of the forum.
        For forums only.

    direct_messages_topic_id (``int``, *optional*):
        Unique identifier of the topic in a channel direct messages chat administered by the current user.
        For directs only only.

    effect_id (``int``, *optional*):
        Unique identifier of the message effect.
        For private chats only.

    show_caption_above_media (``bool``, *optional*):
        Pass True, if the caption must be shown above the message media.

    reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*):
        Describes reply parameters for the message that is being sent.

    schedule_date (:py:obj:`~datetime.datetime`, *optional*):
        Date when the message will be automatically sent.

    repeat_period (``int``, *optional*):
        Period after which the message will be sent again in seconds.

    protect_content (``bool``, *optional*):
        Protects the contents of the sent message from forwarding and saving.

    no_sound (``bool``, *optional*):
        Pass True, if the uploaded video is a video message with no sound.
        Doesn't work for external links.

    business_connection_id (``str``, *optional*):
        Unique identifier of the business connection on behalf of which the message will be sent.

    allow_paid_broadcast (``bool``, *optional*):
        If True, you will be allowed to send up to 1000 messages per second.
        Ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message.
        The relevant Stars will be withdrawn from the bot's balance.
        For bots only.

    paid_message_star_count (``int``, *optional*):
        The number of Telegram Stars the user agreed to pay to send the messages.

    suggested_post_parameters (:obj:`~pyrogram.types.SuggestedPostParameters`, *optional*):
        Information about the suggested post.

    reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
        Additional interface options. An object for an inline keyboard, custom reply keyboard,
        instructions to remove reply keyboard or to force a reply from the user.

    progress (``Callable``, *optional*):
        Pass a callback function to view the file transmission progress.
        The function must take *(current, total)* as positional arguments (look at Other Parameters below for a
        detailed description) and will be called back each time a new file chunk has been successfully
        transmitted.

    progress_args (``tuple``, *optional*):
        Extra custom arguments for the progress callback function.
        You can pass anything you need to be available in the progress callback scope; for example, a Message
        object or a Client instance in order to edit the message with the updated progress status.

Other Parameters:
    current (``int``):
        The amount of bytes transmitted so far.

    total (``int``):
        The total size of the file.

    *args (``tuple``, *optional*):
        Extra custom arguments as defined in the ``progress_args`` parameter.
        You can either keep ``*args`` or add every single extra argument in your function signature.

Returns:
    :obj:`~pyrogram.types.Message` | ``None``: On success, the sent video message is returned, otherwise, in
    case the upload is deliberately stopped with :meth:`~pyrogram.Client.stop_transmission`, None is returned.

Example:
    .. code-block:: python

        # Send video by uploading from local file
        await app.send_video("me", "video.mp4")

        # Add caption to the video
        await app.send_video("me", "video.mp4", caption="video caption")

        # Send self-destructing video
        await app.send_video("me", "video.mp4", ttl_seconds=10)

        # Send view-once video
        await app.send_video("me", "video.mp4", view_once=True)

        # Add video_cover to the video
        await app.send_video(channel_id, "video.mp4", video_cover="photo.jpg")

        # Keep track of the progress while uploading
        async def progress(current, total):
            print(f"{current * 100 / total:.1f}%")

        await app.send_video("me", "video.mp4", progress=progress)
Nzj`reply_to_message_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zg`reply_to_chat_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zh`reply_to_story_id` is deprecated and will be removed in future updates. Use `reply_parameters` instead.za`quote_text` is deprecated and will be removed in future updates. Use `reply_parameters` instead.ze`quote_entities` is deprecated and will be removed in future updates. Use `reply_parameters` instead.zc`quote_offset` is deprecated and will be removed in future updates. Use `reply_parameters` instead.)
message_idr   story_idquotequote_parse_moder:   quote_position)file)peermediaz
^https?://)url)idaccess_hashfile_reference)r4   r5   z	video/mp4i)r$   r   wh)r#   )		mime_typerC   r   spoilerr"   r!   video_timestampnosound_video
attributes)rF   r   rM   r!   rN   )r   r   )rD   rE   silentinvert_mediareply_to	random_idr+   
noforwardsallow_paid_floodskipallow_paid_starssuggested_postr3   effect)r/   )clientmessagesr   )file_id	file_partr   )2anylogwarningr   ReplyParametersresolve_peer
isinstancestrospathisfileinvoker   	functionsr[   UploadMediaInputMediaUploadedPhoto	save_filerematchInputMediaPhotoExternalr   get_input_media_from_file_idr   PHOTOrG   
InputPhotophotorH   rI   InputMediaUploadedDocumentguess_mime_typeDocumentAttributeVideoDocumentAttributeFilenamebasenameInputMediaDocumentExternalVIDEOr!   rN   name	SendMediaget_reply_tornd_iddatetime_to_timestampwriteparse_text_entitiesparse_messagesr   valuer	   )0r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   rC   vcover_filevcover_mediarD   rE   rr[   es0                                                   Q/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/messages/send_video.py
send_videoSendVideo.send_video!   s    J #4/ ,!-$&d*D(	
 	
 #. A  +} !,~ %w ){ 'y  %44.(* !+-+  &&w//C	&k3//ww~~k22-1[[MM22>>%)&)ii&G&G/3~~k/J)J 'H '" ? . ( ,<<-1[[MM22>>%)&)ii&G&G(3 'H '" ? . ( ',&H&HV^VdVd&e&h&h)-..::!%"%))"C"C+/>>++F%F #D # ; * $L  "%))"6"6'--00$0$6$6$B$B'3'9'9'H'H #7 #K %%%77>>%(("&.."77E!%Xe!ffDII@@"&"6"6u"="L!5>MK +#$/(=&.II<<3E3M)1"'"(	 =   II??)JnWYW^W^WgWghmWn?o$ A E& XXlE22II@@!5>MK +$/(= A E ">>uhnns|bo  CN  \g  hE(3E%,AE)"nnU33!^^EHTa^bb		<<"2293J

KZ{1:' +$9"*		88/A/IT%-#$	 9  		;;iF]SXS]S];^  = ( ="kk..88 !%"'#7#?4)A+0+=+= $ 0 1 8	, & '+kkm*/*E*Em*T'61E-DPi+D+J+J+LosKW|/A/A$/G)G)G]a#,%& %*$=$=dZ$jj'* 0F- *  A6 &+%9%9PQ%RRH*28A;<<G 0 *K	(( &G	$$ 8fB 4b:& *Hj)6  S ' T..177.SSST5 @   		s|  C'\8)Z8*\8/B\( 	Z;
\( Z>A7\( [B\( #[$\( 3[4B4\( ([
)\( [E\( [\( *[+B5\( !A[  :[;A[  [$"[  ;[<[  [	[  \( %[&\( 5\86\( 7\8;\( >\( \( \( \( 
\( \( \( \( [  [  [  [  \(  
\"*(\\\\( \""\( (
\52\84\55\8)% NNNNNr   r   r   NNNNTNNNNNNNNNTNNNNNNr   NNNNNN)__name__
__module____qualname____firstlineno__r   intrd   r   r   r   boolr   r   tupler   __static_attributes__r       r   r   r       s   
 268< %),0&*#'%)!%(,)-48"&! $&*%)'+EI !!#',0!%6: ]__sCx_ S(]#_ 	_
 ./_ 45_ _ _ _ _ _ _  #_ 3=)_ S(]#_  !_" !#_$ #%_& '_( #&)_* +_, #'-_. 2/_0  1_2 3_4 5_6 7_8 !$9_: #;_< "%=_> $C?_@ 
A_L M_N O_R !S_T  S/U_V W_X Y_Z 23[_\ ]_^ 
/	"__ _r   r   )loggingre   rm   r   typingr   r   r   r   r   pyrogramr	   r
   r   r   r   pyrogram.errorsr   pyrogram.file_idr   	getLoggerr   r_   r   r   r   r   <module>r      sD   &  	 	  < <  ? ? + %!` `r   