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

@@ -12,4 +12,7 @@ class Ips(Model):
class Meta:
database = db1
table_name = 'ips'
table_name = 'ips'
if __name__ == '__main__':
Ips.create_table()

View File

@@ -61,9 +61,11 @@ class Weex30Copy(Model):
table_name = 'weex_30_copy1'
# 连接到数据库
db.connect()
# # 连接到数据库
# db.connect()
#
# # 创建表(如果表不存在)
# db.create_tables([Weex15])
# db.create_tables([Weex1])
# 创建表(如果表不存在)
db.create_tables([Weex15])
db.create_tables([Weex1])

View File

@@ -1,6 +1,7 @@
from peewee import *
from models import db1
from models.ips import Ips
class Xstart(Model):
@@ -14,3 +15,8 @@ class Xstart(Model):
class Meta:
database = db1 # 所属数据库
table_name = 'xstart'
if __name__ == '__main__':
Xstart.create_table()

View File

@@ -1,6 +1,6 @@
from peewee import *
# 假设 db 已经在其他地方定义并连接到数据库
from models import db1
from models import db1
class XToken(Model):
@@ -16,6 +16,9 @@ class XToken(Model):
email_pwd = CharField(max_length=255, null=True) # token 字段,最大长度 255可为空
class Meta:
database = db1 # 所属数据库
database = db1 # 所属数据库
table_name = 'x_token' # 表名
if __name__ == '__main__':
XToken.create_table()

Binary file not shown.

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()