fix some bugs
This commit is contained in:
parent
8a77641c47
commit
1bd8ee4a9b
21
README.md
21
README.md
@ -1,12 +1,13 @@
|
||||
# catch-the-fish
|
||||
|
||||
https://invites.fun/ 抓鱼脚本
|
||||
|
||||
使用方法
|
||||
git clone http://q.3rd.hk:10000/Qubot/catch-the-fish
|
||||
|
||||
cd catch-the-fish
|
||||
|
||||
sudo chmod 777 catch
|
||||
|
||||
./catch
|
||||
https://invites.fun/ 抓鱼脚本
|
||||
|
||||
使用方法
|
||||
|
||||
git clone http://q.3rd.hk:10000/Qubot/catch-the-fish
|
||||
|
||||
cd catch-the-fish
|
||||
|
||||
sudo chmod 777 catch
|
||||
|
||||
./catch
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import requests
|
||||
import time
|
||||
import requests
|
||||
import sys
|
||||
|
||||
base_url = "https://invites.fun/api/users?include&sort&page%5Boffset%5D="
|
||||
|
||||
@ -9,9 +9,14 @@ usernames = []
|
||||
total_count = 0
|
||||
my_catch_count = 0
|
||||
|
||||
flarum_remember = "izvHQwoKddgwYWC9e1dFLfcADCOjMnhl2xIEk2BP"
|
||||
flarum_session = "cgU39wNNAsVd6JbmaIpHZk7AyetKlOrk17ESRe4x"
|
||||
|
||||
cookies = {
|
||||
"flarum_remember": "izvHQwoKddgwYWC9e1dFLfcADCOjMnhl2xIEk2BP",
|
||||
"flarum_session": "sGfH8SLqRdmVU4b9p9IIcIu2LEmL6vt0BtkR4GS9"
|
||||
# "flarum_remember": "izvHQwoKddgwYWC9e1dFLfcADCOjMnhl2xIEk2BP",
|
||||
# "flarum_session": "sGfH8SLqRdmVU4b9p9IIcIu2LEmL6vt0BtkR4GS9"
|
||||
"flarum_remember": f"{flarum_remember}",
|
||||
"flarum_session": f"{flarum_session}"
|
||||
}
|
||||
|
||||
fish_id=0
|
||||
@ -34,7 +39,8 @@ headers1 = {
|
||||
"Connection": "keep-alive",
|
||||
"Content-Length": "2",
|
||||
"Content-Type": "application/json; charset=UTF-8",
|
||||
"Cookie": "flarum_remember=izvHQwoKddgwYWC9e1dFLfcADCOjMnhl2xIEk2BP; flarum_session=cgU39wNNAsVd6JbmaIpHZk7AyetKlOrk17ESRe4x",
|
||||
"Cookie": f"flarum_remember={flarum_remember}; flarum_session={flarum_session}",
|
||||
# "Cookie": "flarum_remember=izvHQwoKddgwYWC9e1dFLfcADCOjMnhl2xIEk2BP; flarum_session=cgU39wNNAsVd6JbmaIpHZk7AyetKlOrk17ESRe4x",
|
||||
"Dnt": "1",
|
||||
"Host": "invites.fun",
|
||||
"Origin": "https://invites.fun",
|
||||
@ -90,14 +96,21 @@ for offset in range(0, 2001, 20):
|
||||
|
||||
response = requests.post(fish_url, json=data, headers=headers1)
|
||||
|
||||
# print(response.status_code) # 打印响应状态码
|
||||
# print(response.json()) # 打印响应内容
|
||||
my_catch_count = response.json()['included'][0]['attributes']['my_catch_count']
|
||||
if response.status_code != 200:
|
||||
print(" ", end="\r", flush=True)
|
||||
print("Cookies过期")
|
||||
sys.exit()
|
||||
|
||||
# print(response.status_code) # 打印响应状态码
|
||||
# print(response.json()) # 打印响应内容
|
||||
|
||||
response_data = response.json()
|
||||
my_catch_count = response_data['included'][0]['attributes']['my_catch_count']
|
||||
# print(my_catch_count)
|
||||
|
||||
output = f"当前页面的值: {offset} 已抓到: {total_count}条鱼 累计抓到: {my_catch_count}条鱼"
|
||||
print(output, end="\r", flush=True)
|
||||
|
||||
time.sleep(1) # 延时1秒
|
||||
|
||||
print("抓鱼结束")
|
||||
print(" ", end="\r", flush=True)
|
||||
print(f"抓鱼结束 这次抓到:{total_count}条鱼 累计抓到: {my_catch_count}条鱼")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user