text stringlengths 1 93.6k |
|---|
# 抓包获取 x_auth_token
|
# 得物森林
|
# export dewu_x_auth_token='Bearer ey**&Bearer ey**',多账号使用换行或&
|
# 青龙拉取命令 ql raw https://raw.githubusercontent.com/q7q7q7q7q7q7q7/ziyou/main/%E5%BE%97%E7%89%A9%E6%A3%AE%E6%9E%97.py
|
# 第一个账号助力作者,其余账号依ck顺序助力
|
# https://t.me/q7q7q7q7q7q7q7_ziyou
|
import os
|
import random
|
import re
|
import sys
|
import time
|
import requests
|
from urllib.parse import urlparse, parse_qs
|
X_AUTH_TOKEN = []
|
SHARE_CODE_LIST = []
|
AUTHOR_SHARE_CODE_LIST = []
|
# X_AUTH_TOKEN = ['Bearer eyJhbGciOi*******',
|
# 'Bearer eyJhbGciOi*******', ]
|
dewu_x_auth_token = os.getenv("dewu_x_auth_token")
|
if dewu_x_auth_token:
|
X_AUTH_TOKEN += dewu_x_auth_token.replace("&", "\n").split("\n")
|
# 下载作者的助力码
|
def download_author_share_code():
|
global AUTHOR_SHARE_CODE_LIST
|
response = requests.get('https://netcut.cn/p/d3436822ba03c0c3')
|
_list = re.findall(r'"note_content":"(.*?)"', response.text)
|
if _list:
|
share_code_list = _list[0].split(r'\n')
|
AUTHOR_SHARE_CODE_LIST += share_code_list
|
# 获得url params 中键为key的值
|
def get_url_key_value(url, key):
|
parsed_url = urlparse(url)
|
query_params = parse_qs(parsed_url.query)
|
_dict = {k: v[0] if len(v) == 1 else v for k, v in query_params.items()}
|
key_value = _dict.get(key)
|
return key_value
|
class DeWu:
|
WATERTING_G: int = 40 # 每次浇水克数
|
REMAINING_G: int = 1800 # 最后浇水剩余不超过的克数
|
User_Agent = "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3"
|
def __init__(self, x_auth_token, index, waterting_g=WATERTING_G, remaining_g=REMAINING_G, user_agent=User_Agent):
|
self.index = index
|
self.waterting_g = waterting_g # 每次浇水克数
|
self.remaining_g = remaining_g # 最后浇水剩余不超过的克数
|
self.session = requests.Session()
|
self.headers = {'appVersion': '5.24.5', 'SK': '', 'User-Agent': user_agent, 'x-auth-token': x_auth_token}
|
self.tree_id = 0 # 树的id
|
self.tasks_completed_number = 0 # 任务完成数
|
self.cumulative_tasks_list = [] # 累计计任务列表
|
self.tasks_dict_list = [] # 任务字典列表
|
self.is_team_tree = False # 是否是团队树
|
# 种树奖品
|
def tree_info(self):
|
url = 'https://app.dewu.com/hacking-tree/v1/user/target/info'
|
response = self.session.get(url, headers=self.headers)
|
response_dict = response.json()
|
# print(response_dict)
|
if response_dict.get('code') == 200:
|
name = response_dict.get('data').get('name')
|
level = response_dict.get('data').get('level')
|
return name, level
|
print(response_dict.get('msg'))
|
return '', ''
|
# 判断是否是团队树
|
def determine_whether_is_team_tree(self):
|
url = 'https://app.dewu.com/hacking-tree/v1/team/info'
|
response = self.session.get(url, headers=self.headers)
|
response_dict = response.json()
|
# print(response_dict)
|
if response_dict.get('data').get('show') is True and response_dict.get('data').get('teamTreeId'):
|
self.is_team_tree = True
|
# 领潮金币签到
|
def check_in(self):
|
url = 'https://app.dewu.com/hacking-game-center/v1/sign/sign'
|
response = self.session.post(url, headers=self.headers)
|
response_dict = response.json()
|
# print(response_dict)
|
if response_dict.get('code') == 200:
|
print(f"签到成功!")
|
return
|
print(f"签到失败! {response_dict.get('msg')}")
|
# 水滴7天签到
|
def droplet_check_in(self):
|
url = 'https://app.dewu.com/hacking-tree/v1/sign/sign_in'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.