From 0818572e8c0043f91d356b37391c9a615574efd0 Mon Sep 17 00:00:00 2001 From: KurimuzonAkuma Date: Thu, 30 Nov 2023 10:34:05 +0300 Subject: [PATCH] Remove url uploading from send_story/edit_story --- pyrogram/methods/stories/edit_story.py | 13 ------------- pyrogram/methods/stories/send_story.py | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/pyrogram/methods/stories/edit_story.py b/pyrogram/methods/stories/edit_story.py index df10e661..868ef751 100644 --- a/pyrogram/methods/stories/edit_story.py +++ b/pyrogram/methods/stories/edit_story.py @@ -49,8 +49,6 @@ class EditStory: .. include:: /_includes/usable-by/users.rst - Note: You must pass one of following paramater *animation*, *photo*, *video* - Parameters: chat_id (``int`` | ``str``): Unique identifier (int) or username (str) of the target chat. @@ -60,7 +58,6 @@ class EditStory: media (``str`` | ``BinaryIO``, *optional*): Video or photo to send. Pass a file_id as string to send a animation that exists on the Telegram servers, - pass an HTTP URL as a string for Telegram to get a animation from the Internet, pass a file path as string to upload a new animation that exists on your local machine, or pass a binary file-like object with its attribute ".name" set for in-memory uploads. @@ -159,16 +156,6 @@ class EditStory: media = raw.types.InputMediaUploadedPhoto( file=file, ) - elif re.match("^https?://", media): - mime_type = self.guess_mime_type(media) - if mime_type == "video/mp4": - media = raw.types.InputMediaDocumentExternal( - url=media, - ) - else: - media = raw.types.InputMediaPhotoExternal( - url=media, - ) else: media = utils.get_input_media_from_file_id(media) else: diff --git a/pyrogram/methods/stories/send_story.py b/pyrogram/methods/stories/send_story.py index 23b3bb75..56f5c4ce 100644 --- a/pyrogram/methods/stories/send_story.py +++ b/pyrogram/methods/stories/send_story.py @@ -51,8 +51,6 @@ class SendStory: .. include:: /_includes/usable-by/users.rst - Note: You must pass one of following paramater *animation*, *photo*, *video* - Parameters: chat_id (``int`` | ``str``): Unique identifier (int) or username (str) of the target chat. @@ -61,7 +59,6 @@ class SendStory: media (``str`` | ``BinaryIO``): Video or photo to send. Pass a file_id as string to send a animation that exists on the Telegram servers, - pass an HTTP URL as a string for Telegram to get a animation from the Internet, pass a file path as string to upload a new animation that exists on your local machine, or pass a binary file-like object with its attribute ".name" set for in-memory uploads. @@ -168,16 +165,6 @@ class SendStory: media = raw.types.InputMediaUploadedPhoto( file=file, ) - elif re.match("^https?://", media): - mime_type = self.guess_mime_type(media) - if mime_type == "video/mp4": - media = raw.types.InputMediaDocumentExternal( - url=media, - ) - else: - media = raw.types.InputMediaPhotoExternal( - url=media, - ) else: media = utils.get_input_media_from_file_id(media) else: