chore: initial commit
This commit is contained in:
45
run_session_creator.sh
Executable file
45
run_session_creator.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#\!/bin/bash
|
||||
# Session 创建运行脚本
|
||||
|
||||
echo "========================================"
|
||||
echo "Pyrogram Session 创建工具"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
echo "此脚本将帮助您创建新的 session 文件"
|
||||
echo "请确保:"
|
||||
echo " 1. Telegram 应用已打开"
|
||||
echo " 2. 准备接收验证码"
|
||||
echo ""
|
||||
echo "电话号码: +66621394851"
|
||||
echo ""
|
||||
read -p "按 Enter 继续..." dummy
|
||||
|
||||
echo ""
|
||||
echo "正在启动创建过程..."
|
||||
echo ""
|
||||
|
||||
# 使用 printf 提供电话号码,但验证码需要手动输入
|
||||
printf "+66621394851\ny\n" | timeout 60 python3 -u create_session_correct.py || {
|
||||
echo ""
|
||||
echo "首次尝试可能因为需要验证码而超时..."
|
||||
echo "让我们再试一次,这次请准备好验证码"
|
||||
echo ""
|
||||
|
||||
# 第二次尝试,允许手动输入验证码
|
||||
python3 create_session_correct.py
|
||||
}
|
||||
|
||||
if [ -f "user_session.session" ]; then
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo "✅ Session 文件创建成功!"
|
||||
echo "========================================"
|
||||
echo "文件: user_session.session"
|
||||
ls -lh user_session.session*
|
||||
echo ""
|
||||
echo "现在可以重启机器人了"
|
||||
else
|
||||
echo ""
|
||||
echo "❌ Session 文件未创建"
|
||||
echo "请检查错误信息"
|
||||
fi
|
||||
Reference in New Issue
Block a user