From 9f9ff0a79492e43616c41208a55fe86bee6f00d2 Mon Sep 17 00:00:00 2001 From: Benny Date: Thu, 21 Dec 2023 19:02:21 +0100 Subject: [PATCH] add max_concurrent_transmissions --- .gitignore | 1 + ytdlbot/client_init.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 737187d..56388a9 100644 --- a/.gitignore +++ b/.gitignore @@ -175,3 +175,4 @@ reinforcement/* /ytdlbot/tasks.session-journal /ytdlbot/premium.session /dump.rdb +/ytdlbot/premium.session-journal diff --git a/ytdlbot/client_init.py b/ytdlbot/client_init.py index 3fa8c20..76b316c 100644 --- a/ytdlbot/client_init.py +++ b/ytdlbot/client_init.py @@ -9,7 +9,7 @@ __author__ = "Benny " from pyrogram import Client -from config import APP_HASH, APP_ID, PYRO_WORKERS, TOKEN, IPv6 +from config import APP_HASH, APP_ID, PYRO_WORKERS, TOKEN, WORKERS, IPv6 def create_app(name: str, workers: int = PYRO_WORKERS) -> Client: @@ -20,4 +20,6 @@ def create_app(name: str, workers: int = PYRO_WORKERS) -> Client: bot_token=TOKEN, workers=workers, ipv6=IPv6, + max_concurrent_transmissions=max(1, WORKERS // 2), + # https://github.com/pyrogram/pyrogram/issues/1225#issuecomment-1446595489 )