From db8fcbd2adb0cacb6a8b012ee5ddf69742b93ceb Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Thu, 26 Feb 2026 12:23:14 +0700 Subject: [PATCH] feat(proxy): remove proxy support --- .env.example | 14 -------------- config.py | 5 ----- main.py | 9 +-------- requirements.txt | 4 ---- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/.env.example b/.env.example index 9bbab1d..3c34c97 100644 --- a/.env.example +++ b/.env.example @@ -2,17 +2,3 @@ PHONE=+1234567890 API_ID=123456789 API_HASH=0123456789abcdef0123456789abcdef GROUP_IDS=1234567890,9876543210 -PROXY_HOST=127.0.0.1 -PROXY_PORT=8080 -PROXY_SECRET=00000000000000000000000000000000 -# From https://github.com/RevEngine3r/telethon-faketls: -# """ -# You can use a base64 secret or hex one, -# But remember to -# Remove "ee" from the starting of hex secret -# And -# Remove "7" from the starting of the base64 secret. -# Example: -# ee9b43b87555bf9464e02bdcd2db8932b07777772e736974652e636f6d -> 9b43b87555bf9464e02bdcd2db8932b07777772e736974652e636f6d -# 7gEBAQEBAQEBAQEBAQEBAQFsaWIuYXJ2YW5jbG91ZC5jb20= -> gEBAQEBAQEBAQEBAQEBAQFsaWIuYXJ2YW5jbG91ZC5jb20= -# """ diff --git a/config.py b/config.py index b8002c1..22db211 100644 --- a/config.py +++ b/config.py @@ -7,10 +7,5 @@ load_dotenv() phone = os.getenv('PHONE') api_id = os.getenv('API_ID') api_hash = os.getenv('API_HASH') - -proxy_host = os.getenv('PROXY_HOST') -proxy_port = int(os.getenv('PROXY_PORT', '0')) if os.getenv('PROXY_PORT') else None -proxy_secret = os.getenv('PROXY_SECRET') - group_ids_str = os.getenv('GROUP_IDS', '') group_ids = [int(id.strip()) for id in group_ids_str.split(',') if id.strip()] if group_ids_str else [] diff --git a/main.py b/main.py index d2e311d..1bbe48c 100644 --- a/main.py +++ b/main.py @@ -3,18 +3,11 @@ import getpass from telethon.errors import SessionPasswordNeededError from telethon.sync import TelegramClient from telethon.tl.types import Chat, Channel -import TelethonFakeTLS from common import * from config import * -if proxy_host and proxy_port and proxy_secret: - proxy = (proxy_host, proxy_port, proxy_secret) - connection = TelethonFakeTLS.ConnectionTcpMTProxyFakeTLS - client = TelegramClient(phone, api_id, api_hash, connection=connection, proxy=proxy) -else: - client = TelegramClient(phone, api_id, api_hash) - +client = TelegramClient(phone, api_id, api_hash) client.connect() if not client.is_user_authorized(): diff --git a/requirements.txt b/requirements.txt index 2dbad20..3716139 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,5 @@ -cffi==2.0.0 -cryptography==46.0.5 pyaes==1.6.1 pyasn1==0.6.2 -pycparser==3.0 python-dotenv==1.2.1 rsa==4.9.1 Telethon==1.42.0 -TelethonFakeTLS==2022.4.4.16.37.38.728726