Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Wenmoux:master #115

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ ql repo https://github.com/Wenmoux/checkbox.git "checkbox|install" "old" "module
<details>
<summary>更新日志</summary>

- 2024-03-02 克拉漫播增加更多任务
- 2024-02-15
- 新增[pdg2pdf](https://www.pdg2pdf.com/)每日签到
- 新增[高清mp4](https://mp4fan.org/)每日登录
Expand Down
51 changes: 44 additions & 7 deletions scripts/kilamanbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ const md5 = require("crypto-js").MD5;
const BASE_URL = 'https://api.kilamanbo.com/api';
let klmsg = "【克拉漫播】:\n"
const headers = {
'Content-Type': 'application/x-www-form-urlencoded',
ua: config.kilamanbo.ua,
"_c": 20,
"x-auth-token": config.kilamanbo.authtoken
};

const makeRequest = async (method, endpoint, data = '') => {
let sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
const makeRequest = async (method, endpoint, data = '',json=null) => {
const url = `${BASE_URL}${endpoint}`;
try {
if(json) headers["Content-Type"] = "application/json"
else headers["Content-Type"] = 'application/x-www-form-urlencoded'
const response = await axios({
method: method,
url: url,
Expand Down Expand Up @@ -40,19 +41,44 @@ const checkIn = async () => {
}
};

const ft = async () => {
const endpoint = '/v433/imgtxt/new/add';
let msg = await axios.get("https://v1.hitokoto.cn/");
const data = {"groupActivityId":0,"imgList":[],"introduce":msg.data.hitokoto,"source":1}
try {
const response = await makeRequest('post', endpoint, data,true);
const msg = response?.h?.msg;
console.log(msg);
if(response.b){ id = response.b.imgTxtResp.id
console.log(`发帖 ${id}`)
await sleep(3000)
let data = `dynamicId=${id}&type=38`
let signedData = `${data}&sign=${getSign(data)}`;
let rss =await makeRequest('post','/v435/dynamic/info/delete',signedData)
console.log(signedData)
console.log(rss)
}
// return msg;
} catch (error) {
const msg = error.response?.data?.h?.msg || error.message;
console.error(msg);
// return msg;
}
};
const getSign = (data) => {
var str = data.split("&").sort().join("&");
return md5("nJi9o;/" + str).toString();
};
const cx = async () => {
const endpoint = '/v433/user/level/info?uid=3100350001213';
const data = 'uid=3100350001213';
const endpoint = '/v433/user/level/info?uid=';
const data = 'uid=';
try {
const response = await makeRequest('get', endpoint);
const msg = response.b;
console.log("获取个人信息成功")

klmsg +=` 昵称:${msg.nickname}\n 等级:Lv${msg.level}(${msg.levelInfo.thisExp}/${msg.levelInfo.nextExp})\n 签到:`
klmsg +=` 昵称:${msg.nickname}\n 等级:Lv${msg.level}(${msg.levelInfo.exp}/${msg.levelInfo.nextExp})\n 签到:`
// console.log(msg)
} catch (error) {
const msg = error.response?.data?.h?.msg || error.message;
console.error("获取个人信息失败:" + msg);
Expand All @@ -73,15 +99,26 @@ const getVideo = async () => {
const response = await makeRequest('get', endpoint);
return response.b.data;
};
const getExp = async (id) => {
console.log("去领宝箱:",id)
const data = `giftPackType=${id}`
const endpoint = `/v435/user/gift/pack/get?giftPackType=${id}&sign=${getSign(data)}`;
const response = await makeRequest('get', endpoint);
console.log(response?.h?.msg);
};

const task = async () => {
let checkinMsg = await checkIn();
let checkinMsg = await checkIn();
let vList = await getVideo();
for (let i = 0; i < 5; i++) {
console.log(`看视频:${vList[i].videoResp.introduce}`)
await complete("21", vList[i].videoResp.idStr);
await complete("4", vList[i].videoResp.idStr);
}
for ( k of [1,2,3]){
await ft()
}
for (c of [1,2,3]) await getExp(c)
await cx()
klmsg+=checkinMsg
return klmsg
Expand Down