feat(proxy): remove proxy support

This commit is contained in:
tiennm99 committed 2026-02-26 12:24:21 +07:00
1 parent 2223780de2
commit db8fcbd2ad
4 files changed
+1 -31

No files matched your search

-14
View File
@@ -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=
# """
-5
View File
@@ -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 []
+1 -8
View File
@@ -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():
-4
View File
@@ -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