rgfewfger

This commit is contained in:
27942
2025-11-28 18:19:42 +08:00
parent c4d8513dba
commit 2002ae0971
7 changed files with 58 additions and 58 deletions

View File

@@ -484,11 +484,11 @@ class Hub_Web:
# except:
# pass
# 养号流程
try:
self.account_nurturing()
except Exception as e:
print(e)
# # 养号流程
# try:
# self.account_nurturing()
# except Exception as e:
# print(e)
self.page.quit()

View File

@@ -7,51 +7,37 @@ from models.xstart import Xstart
if __name__ == '__main__':
# with open('ip.txt', 'r', encoding='utf-8') as f:
# content = f.read()
#
# tasks = [] # 创建任务列表
# lines = content.split('\n')
#
# n = 0
# for _, line in enumerate(lines):
# # print(line)
# # 解析代理 URL
# parsed = urlparse(line)
# # 获取代理用户名和密码
# username = parsed.username
# password = parsed.password
#
# # 获取代理主机和端口
# proxy_host = parsed.hostname
# proxy_port = parsed.port
#
# # host = netloc_parts[0]
# # port = int(netloc_parts[1])
# #
# # # 提取用户名和密码
# # username = netloc_parts[2]
# # password = netloc_parts[3]
#
# # # 输出解析结果
# # print(f"协议: {scheme}")
# # print(f"主机: {host}")
# # print(f"端口: {port}")
# # print(f"用户名: {username}")
# # print(f"密码: {password}")
#
# Ips.get_or_create(
# host=proxy_host,
# port=proxy_port,
# username=username,
# password=password,
# )
# 打开 ip.txt 文件,以只读模式和 UTF-8 编码读取文件内容
with open('ip.txt', 'r', encoding='utf-8') as f:
content = f.read()
for i in Xstart.select().where(
Xstart.start == "0"
):
print(i.x_id)
# 将文件内容按换行符分割成多行,存储在 lines 列表中
lines = content.split('\n')
deleteBrowser(id=i.bit_id)
# 遍历 lines 列表中的每一行
for line in lines:
if line: # 跳过空行
# 手动解析代理信息
scheme, rest = line.split('://', 1)
host_port_user_pass = rest.split(':', 3)
host = host_port_user_pass[0]
port = int(host_port_user_pass[1])
username = host_port_user_pass[2]
password = host_port_user_pass[3]
i.delete_instance()
# 尝试从数据库中查找或创建一个新的代理记录
Ips.get_or_create(
host=host,
port=port,
username=username,
password=password,
)
# for i in Xstart.select().where(
# Xstart.start == "0"
# ):
# print(i.x_id)
#
# deleteBrowser(id=i.bit_id)
#
# i.delete_instance()