rgfewfger
This commit is contained in:
18
bit_tools.py
18
bit_tools.py
@@ -1,5 +1,9 @@
|
||||
import json
|
||||
import requests
|
||||
from peewee import fn
|
||||
|
||||
from models.ips import Ips
|
||||
from models.xstart import Xstart
|
||||
|
||||
url = "http://127.0.0.1:54345"
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
@@ -149,3 +153,17 @@ def group_add(groupName):
|
||||
res = requests.post(f'{url}/group/add', data=json.dumps(json_data), headers=headers)
|
||||
|
||||
return res.json()
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# for i in Xstart.select().where(
|
||||
# Xstart.x_id.is_null()
|
||||
# ):
|
||||
# ips_info = Ips.select().where(Ips.start == 1).order_by(fn.Rand()).get()
|
||||
#
|
||||
# update_proxy_Browser(
|
||||
# id=i.bit_id,
|
||||
# host=ips_info.host,
|
||||
# port=ips_info.port,
|
||||
# proxyUserName=ips_info.username,
|
||||
# proxyPassword=ips_info.password
|
||||
# )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from peewee import *
|
||||
|
||||
from models import db1
|
||||
from models import db1
|
||||
|
||||
|
||||
class Ips(Model):
|
||||
@@ -9,10 +9,12 @@ class Ips(Model):
|
||||
port = CharField(null=True)
|
||||
username = CharField(null=True)
|
||||
password = CharField(null=True)
|
||||
start = IntegerField(null=True)
|
||||
|
||||
class Meta:
|
||||
database = db1
|
||||
table_name = 'ips'
|
||||
|
||||
if __name__ == '__main__':
|
||||
Ips.create_table()
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# Ips.create_table()
|
||||
|
||||
Binary file not shown.
BIN
telegram/sign.db
BIN
telegram/sign.db
Binary file not shown.
77
test.py
77
test.py
@@ -1,28 +1,65 @@
|
||||
from cozepy import Coze, TokenAuth, Message, ChatEventType, COZE_CN_BASE_URL
|
||||
import random
|
||||
import time
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
from curl_cffi import requests
|
||||
|
||||
from models.ips import Ips
|
||||
|
||||
cookies = {
|
||||
'PHPSESSID': 'a99b27b7-0c15-324d-49f0-29009b795783',
|
||||
'ipsb': 'Dn42KhiATwEbRov7et5J6FBspLaZdXVg',
|
||||
}
|
||||
|
||||
headers = {
|
||||
'accept': '*/*',
|
||||
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
'cache-control': 'no-cache',
|
||||
'dnt': '1',
|
||||
'pragma': 'no-cache',
|
||||
'referer': 'https://ip.sb/',
|
||||
'sec-ch-ua': '"Chromium";v="142", "Microsoft Edge";v="142", "Not_A Brand";v="99"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'sec-fetch-dest': 'script',
|
||||
'sec-fetch-mode': 'no-cors',
|
||||
'sec-fetch-site': 'same-site',
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0',
|
||||
# 'cookie': 'PHPSESSID=a99b27b7-0c15-324d-49f0-29009b795783; ipsb=Dn42KhiATwEbRov7et5J6FBspLaZdXVg',
|
||||
}
|
||||
|
||||
|
||||
def to_xx(user_id, quest_text):
|
||||
"""调用Coze API进行对话"""
|
||||
coze = Coze(auth=TokenAuth(token="pat_TNHVdiVDn9poKjUXYqVArNwGd9C2cWIIP04ltz4N85WClayks7VuNDF9ewHb5rTi"),
|
||||
base_url=COZE_CN_BASE_URL)
|
||||
def main(sql_info):
|
||||
proxies = {
|
||||
'http': f'socks5://{sql_info.username}:{sql_info.password}@{sql_info.host}:{sql_info.port}',
|
||||
'https': f'socks5://{sql_info.username}:{sql_info.password}@{sql_info.host}:{sql_info.port}',
|
||||
}
|
||||
|
||||
bot_id = "7566918492960620559"
|
||||
user_id = user_id
|
||||
# socks5://92.113.106.14:30014:t5742:x335757
|
||||
for i in range(5):
|
||||
try:
|
||||
response = requests.get(
|
||||
'https://ipv4.ip.sb/addrinfo',
|
||||
headers=headers,
|
||||
proxies=proxies,
|
||||
)
|
||||
|
||||
text = ""
|
||||
for event in coze.chat.stream(
|
||||
bot_id=bot_id,
|
||||
user_id=user_id,
|
||||
additional_messages=[
|
||||
Message.build_user_question_text(quest_text)
|
||||
]
|
||||
):
|
||||
if event.event == ChatEventType.CONVERSATION_MESSAGE_DELTA:
|
||||
message = event.message
|
||||
text += message.content
|
||||
print(response.json()["address"])
|
||||
|
||||
return text
|
||||
if response.json()["address"] == sql_info.host:
|
||||
sql_info.start = 1
|
||||
sql_info.save()
|
||||
|
||||
break
|
||||
|
||||
|
||||
except:
|
||||
time.sleep(random.randint(1, 3))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(to_xx(user_id="7566918492960620559", quest_text="我想要加入你们公司,需要什么要求"))
|
||||
|
||||
with ThreadPoolExecutor(max_workers=100) as executor:
|
||||
for i in Ips.select():
|
||||
executor.submit(main, i)
|
||||
time.sleep(random.randint(1, 3))
|
||||
|
||||
Reference in New Issue
Block a user