Phase 0 MVP: Telegram Archiver fully functional (992 posts tested)

This commit is contained in:
2026-03-06 22:15:50 +03:00
parent bb8c7766b4
commit b76e27afcb
14 changed files with 1171 additions and 134 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env python
"""Interactive login script for Telegram Archiver."""
import sys
import os
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
# Set working directory to project root for .env loading
os.chdir(project_root)
from app.telethon_client import TelethonArchiver
from config import get_settings
import asyncio
async def login():
"""Interactive login to Telegram."""
settings = get_settings()
print(f"Connecting to Telegram as {settings.phone}...")
async with TelethonArchiver(settings) as client:
print("Successfully logged in!")
print(f"Session saved to: {settings.session_path}")
# Test by getting me info
me = await client.client.get_me()
print(f"\nLogged in as: {me.first_name} @{me.username}")
if __name__ == "__main__":
asyncio.run(login())