Add Telegram finder source

This commit is contained in:
2026-07-14 08:59:05 +05:00
parent 37991ddce6
commit a73ff54140
10 changed files with 454 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import asyncio
from config import OUTPUT_FILE
class ResultWriter:
"""Пишет найденные свободные юзернеймы построчно. Файл открывается на
дозапись при каждом вызове add(), так что если скрипт упадёт на середине
прогона - уже найденное никуда не денется."""
def __init__(self, path: str = OUTPUT_FILE):
self.path = path
self._lock = asyncio.Lock()
def reset(self):
open(self.path, "w", encoding="utf-8").close()
async def add(self, profile_url: str, username: str):
line = f"{profile_url} - {username}\n"
async with self._lock:
with open(self.path, "a", encoding="utf-8") as f:
f.write(line)
f.flush()