1 Star 0 Fork 0

ydna0/test-repo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
get_record.py 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
ydna0 提交于 2023-11-22 08:47 . update get_record.py.
import requests
import json
from get_token import get_oepkgs_token
def get_build_record(opekgstoken, jobName,jobId):
id=str(jobId)
url = 'https://build.dev.oepkgs.net/api/build/task/getBuildRecord/'+id+'?pageNum=1&pageSize=5'
headers = {
'authority': 'build.dev.oepkgs.net',
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9,zh;q=0.8,zh-CN;q=0.7',
'cache-control': 'no-cache',
'content-type': 'application/json',
'cookie':
'auth_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxMDksInVzZXJfbmFtZSI6ImRpZGkiLCJUWiI6IkFzaWEvU2hhbmdoYWkiLCJleHAiOjE2OTM1Mzk4MjgsImlhdCI6MTY5MzUzODAyOH0.sFZYWM-YiKKGcD2udonHmCM_kLxyb3Dt0P6xQZs49u8',
'dnt': '1',
'pragma': 'no-cache',
'referer': 'https://build.dev.oepkgs.net/rpm/task',
'sec-ch-ua': '"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"',
'x-auth-token': opekgstoken,
}
params = {
"jobName": jobName,
}
response = requests.get(url, headers=headers, params=params)
print(response)
res_data = json.loads(response.text)
print(res_data['data'])
if len(res_data['data']['list'])==0:
return "no build task"
build_result=res_data['data']['list'][0]
print(build_result)
re=build_result['result']
print(re)
return re
#token=get_oepkgs_token()
#re=get_build_record(token, "13369748-64fe-4e63-b2cd-aee9cc6eb315",1015)
#print(re)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ydna0/test-repo.git
git@gitee.com:ydna0/test-repo.git
ydna0
test-repo
test-repo
master

搜索帮助