讲解
-
如果说你在本地运行过始皇的自动翻译你就可以魔改代码获取你的验证码,因为你的session已经在本地存储了
-
此处不做过多解释了
开始
-
获取一个session(session理论有效期为1年)
from telethon.sync import TelegramClient from telethon.sessions import StringSession from termcolor import colored, cprint import socks import os import logging import json host = "192.168.18.22" port = 6153 proxy = (socks.SOCKS5, host, port) api_id = 'api_id' api_hash = 'api_hash' def main(): while True: with TelegramClient(StringSession(), api_id, api_hash) as client: session_str = client.session.save() user_name = "me" if not client.is_bot() else input(colored("Enter the username: ", "green")) client.send_message(user_name, session_str) cprint("please check your Telegram Saved Messages/User's PM for the StringSession ", "yellow") break if __name__ == "__main__": main()
-
它将会在你的tg中显示
运行
- docker compose 运行
version: '3'
services:
app:
image: whitek/tg_translate:latest
restart: always
environment:
- PROXY_HOST=192.168.18.22 # 你的代理ip
- PROXY_PORT=6135 #你的代理端口
- API_ID=xxx
- API_HASH=xxx
- SESSION=xxx