1 Star 0 Fork 0

楠寻/yjwj-spider

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
yjwjrank.py 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
楠寻 提交于 2024-08-09 23:40 . 主体功能实现
import requests
import urllib
from urllib import parse
import time
def getname():
oldestname = input("请输入永劫无间ID(请注意,如果发现查询出来的战绩与自己战绩不符,说明你的id输入有误,请检查是否有特殊字符或空格):")
name = urllib.parse.quote(oldestname)
return name
def nameolding(name):
return urllib.parse.unquote(name)
def hint(name):
url = f'https://record.uu.163.com/api/naraka/auth/{name}/163'
headers = {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"priority": "u=1, i",
"referer": "https://record.uu.163.com/naraka/query",
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"cookie": "",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"
}
response = requests.get(url, headers=headers)
def getrecord(name):
url = 'https://record.uu.163.com/api/naraka/battles'
headers = {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"priority": "u=1, i",
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"cookie": "",
"sec-fetch-mode": "cors",
"referer": f"https://record.uu.163.com/naraka/?name={name}&server=163",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0"
}
'''for i in range(1, 5):
params={
"page": f"{i}",
"page_size": "10"
}
response = requests.get(url, headers=headers, params=params)
print(response.text)'''
params={
"page": "1",
"page_size": "10"
}
response = requests.get(url, headers=headers, params=params)
data_json = response.text
return data_json
def time_shift(timestamp):
return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(timestamp))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/njmxye/yjwj-spider.git
git@gitee.com:njmxye/yjwj-spider.git
njmxye
yjwj-spider
yjwj-spider
main

搜索帮助