mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Merge branch 'master' into docs
This commit is contained in:
commit
5b3e5133d8
@ -1086,6 +1086,7 @@ class Client:
|
|||||||
duration: int = 0,
|
duration: int = 0,
|
||||||
width: int = 0,
|
width: int = 0,
|
||||||
height: int = 0,
|
height: int = 0,
|
||||||
|
supports_streaming: bool = None,
|
||||||
disable_notification: bool = None,
|
disable_notification: bool = None,
|
||||||
reply_to_message_id: int = None):
|
reply_to_message_id: int = None):
|
||||||
"""Use this method to send video files.
|
"""Use this method to send video files.
|
||||||
@ -1117,6 +1118,9 @@ class Client:
|
|||||||
height (:obj:`int`, optional):
|
height (:obj:`int`, optional):
|
||||||
Video height.
|
Video height.
|
||||||
|
|
||||||
|
supports_streaming (:obj:`bool`, optional):
|
||||||
|
Pass True, if the uploaded video is suitable for streaming.
|
||||||
|
|
||||||
disable_notification (:obj:`bool`, optional):
|
disable_notification (:obj:`bool`, optional):
|
||||||
Sends the message silently.
|
Sends the message silently.
|
||||||
Users will receive a notification with no sound.
|
Users will receive a notification with no sound.
|
||||||
@ -1143,6 +1147,7 @@ class Client:
|
|||||||
file=file,
|
file=file,
|
||||||
attributes=[
|
attributes=[
|
||||||
types.DocumentAttributeVideo(
|
types.DocumentAttributeVideo(
|
||||||
|
supports_streaming=supports_streaming,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
w=width,
|
w=width,
|
||||||
h=height
|
h=height
|
||||||
|
@ -31,7 +31,7 @@ from . import utils
|
|||||||
|
|
||||||
|
|
||||||
class HTML:
|
class HTML:
|
||||||
HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])(.*)\2)?>(.*)</\1>")
|
HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])([^<]+)\2)?>([^>]+)</\1>")
|
||||||
MENTION_RE = re.compile(r"tg://user\?id=(\d+)")
|
MENTION_RE = re.compile(r"tg://user\?id=(\d+)")
|
||||||
|
|
||||||
def __init__(self, peers_by_id):
|
def __init__(self, peers_by_id):
|
||||||
@ -44,7 +44,7 @@ class HTML:
|
|||||||
|
|
||||||
for match in self.HTML_RE.finditer(text):
|
for match in self.HTML_RE.finditer(text):
|
||||||
start = match.start() - offset
|
start = match.start() - offset
|
||||||
style, url, body = match.groups()
|
style, url, body = match.group(1, 3, 4)
|
||||||
|
|
||||||
if url:
|
if url:
|
||||||
mention = self.MENTION_RE.match(url)
|
mention = self.MENTION_RE.match(url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user