-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (27 loc) · 922 Bytes
/
Copy pathapp.py
File metadata and controls
36 lines (27 loc) · 922 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
32
33
34
35
36
#!/usr/bin/env python3
"""
Telegram Downloader – Entry point (python-telegram-bot + Telethon).
Features:
• Telegram Stories (photo / video)
• Public channel posts
• Restricted content (when user account has access)
• Photos, Videos, Documents, Voice, Audio, Animations, Stickers
• Colored InlineKeyboardButton styles (primary / success / danger)
"""
from __future__ import annotations
import sys
from core.logger import logger
from core.manager import build_application, on_shutdown, on_startup
def main() -> None:
app = build_application()
app.post_init = on_startup
app.post_shutdown = on_shutdown
try:
app.run_polling(drop_pending_updates=True)
except KeyboardInterrupt:
logger.info("Shutting down by user request")
except Exception as exc:
logger.exception("Fatal error: %s", exc)
sys.exit(1)
if __name__ == "__main__":
main()