feat(network): add proxy support and docker host-gateway configuration

This commit is contained in:
mamad
2026-08-27 20:43:22 +03:30
parent 76a19131a6
commit 62af84c82e
6 changed files with 35 additions and 3 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ from db.repository import Repository
from core.dedup import compute_content_hash, compute_file_hash
from services.ai_processor import AIProcessor
from core.metrics import COLLECTED_POSTS_TOTAL
from core.proxy import get_telegram_proxy
logger = logging.getLogger(__name__)
@@ -31,7 +32,7 @@ class CollectorService:
self.session_name = session_name or os.path.join(SESSION_DIR, "collector.session")
os.makedirs(os.path.dirname(self.session_name), exist_ok=True)
os.makedirs(MEDIA_DIR, exist_ok=True)
self.client = TelegramClient(self.session_name, self.api_id, self.api_hash)
self.client = TelegramClient(self.session_name, self.api_id, self.api_hash, proxy=get_telegram_proxy())
async def start(self):
logger.info("Starting Collector Userbot...")