faster telethon?
Browse files- App/Worker.py +2 -2
- App/__init__.py +7 -7
- requirements.txt +1 -0
App/Worker.py
CHANGED
@@ -105,8 +105,8 @@ def cleanup_temp_directory(
|
|
105 |
):
|
106 |
try:
|
107 |
print("sending...")
|
108 |
-
bot.send_video(chat_id=chat_id,caption="Your Video Caption",video=output_dir)
|
109 |
-
|
110 |
except Exception as e:
|
111 |
print(e)
|
112 |
finally:
|
|
|
105 |
):
|
106 |
try:
|
107 |
print("sending...")
|
108 |
+
# bot.send_video(chat_id=chat_id,caption="Your Video Caption",video=output_dir)
|
109 |
+
bot.send_file(chat_id, file=output_dir, caption="Your video caption")
|
110 |
except Exception as e:
|
111 |
print(e)
|
112 |
finally:
|
App/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from pyrogram import Client
|
2 |
-
from telethon import TelegramClient
|
3 |
from telethon.sessions import StringSession
|
4 |
|
5 |
import os
|
@@ -8,11 +8,11 @@ import os
|
|
8 |
TELEGRAM_SESSION = os.environ.get("TELEGRAM_SESSION")
|
9 |
TELEGRAM_SESSION_PYROGRAM = os.environ.get("TELEGRAM_SESSION_PYROGRAM")
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
|
18 |
-
bot: Client = Client("mboneabot", session_string=TELEGRAM_SESSION_PYROGRAM, workers=5 ,workdir="/srv")
|
|
|
1 |
from pyrogram import Client
|
2 |
+
from telethon.sync import TelegramClient
|
3 |
from telethon.sessions import StringSession
|
4 |
|
5 |
import os
|
|
|
8 |
TELEGRAM_SESSION = os.environ.get("TELEGRAM_SESSION")
|
9 |
TELEGRAM_SESSION_PYROGRAM = os.environ.get("TELEGRAM_SESSION_PYROGRAM")
|
10 |
|
11 |
+
bot: TelegramClient = TelegramClient(
|
12 |
+
StringSession(TELEGRAM_SESSION),
|
13 |
+
api_id=870972,
|
14 |
+
api_hash="ce2efaca02dfcd110941be6025e9ac0d",
|
15 |
+
)
|
16 |
|
17 |
|
18 |
+
# bot: Client = Client("mboneabot", session_string=TELEGRAM_SESSION_PYROGRAM, workers=5 ,workdir="/srv")
|
requirements.txt
CHANGED
@@ -17,3 +17,4 @@ TgCrypto
|
|
17 |
git+https://github.com/redis/redis-py.git
|
18 |
asgiref
|
19 |
pipx
|
|
|
|
17 |
git+https://github.com/redis/redis-py.git
|
18 |
asgiref
|
19 |
pipx
|
20 |
+
cryptg
|