-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_video.py
More file actions
31 lines (23 loc) · 927 Bytes
/
upload_video.py
File metadata and controls
31 lines (23 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import asyncio
import os
import sys
# Добавляем корень проекта в sys.path
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from aiogram import Bot
from aiogram.types import FSInputFile
from config import BOT_TOKEN, ADMIN_ID
async def main():
bot = Bot(token=BOT_TOKEN, request_timeout=300)
video_path = os.path.join(os.path.dirname(__file__), "mobile_ver_compressed.mp4")
if not os.path.exists(video_path):
print(f"Error: {video_path} not found")
return
print("Uploading video to Telegram...")
video = FSInputFile(video_path)
# Send to admin
msg = await bot.send_video(chat_id=ADMIN_ID, video=video, caption="Вот ваш file_id для видео!")
file_id = msg.video.file_id
print(f"\n✅ Upload successful!\nFILE_ID: {file_id}\n")
await bot.session.close()
if __name__ == "__main__":
asyncio.run(main())