-
Notifications
You must be signed in to change notification settings - Fork 18
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
[BUG] pixiv需要代理 #59
Comments
来个id,我试试 |
93918985 |
我这边没有问题,建议先检查后端的输出,是否有风控问题(一般都是这个) |
gocq也是没反应 |
我这个号基本不会有风控问题,天天隔壁cqps来色图没出过事( |
https://cowtransfer.com/s/43cb9b87fa384e |
你都部署成功了我不需要看你安装过程吧... |
那这问题咋解决,我提供不了更多信息了 |
啊这个不是过程,是npm i之后的项目,你跑这个看看能不能复现 |
我用你的项目试了,可以用 |
你现在把gocq的log level 改成info或debug,确定是不是真的没有问题 |
我自己也重新安装了一次,没有出现问题 |
trace等级的日志 |
虽然不知道是什么问题,你先把 import axios from "axios";
const deleteMsg = global.config.pixiv.deleteMsg;
function pixivCheck(context, replyFunc, bot) {
console.log(111)
if (/^看看p站.?/i.test(context.message)) {
let pic_id = /\d+/.exec(context.message);
console.log(222,pic_id)
if (pic_id != null) singleArtwork(pic_id[0], replyFunc, context, bot);
return true;
}
else return false;
}
async function checkImage(url, method = 'HEAD') {
return axios({
url,
method
}).catch(err => {return err.response});
}
function imageCQcode(pic_id) {
return `[CQ:image,,cache=0,file=https://pixiv.cat/${pic_id}.jpg]`;
}
async function singleArtwork(pic_id, replyFunc, context, bot) {
let payload = "";
let url = `https://pixiv.cat/${pic_id}.jpg`
let res = await checkImage(url, "GET");
let delete_flag = true;
console.log(333)
if (res.status == 404) {
if (/這個作品ID中有 (\d{1,2}) 張圖片/.test(res.data)) {
const num_img = parseInt(/這個作品ID中有 (\d{1,2}) 張圖片/.exec(res.data)[1]);
for (let i = 1; i < num_img + 1; i++) {
payload += imageCQcode(`${pic_id}-${i}`);
}
}
else if (/這個作品ID中有多張圖片/.test(res.data)) {
let i = 1;
do {
let url = `https://pixiv.cat/${pic_id}-${i}.jpg`;
res = await checkImage(url);
if (res.status != 200) break;
else payload += imageCQcode(`${pic_id}-${i}`);
i++;
}
while (res != false);
}
else {
payload = "图可能被删了";
delete_flag = false;
}
}
else payload = imageCQcode(pic_id);
sender(replyFunc, context, payload, bot, delete_flag);
}
function sender(replyFunc, context, payload, bot, delete_flag) {
console.log(444, payload)
replyFunc(context, payload).then(res => {
console.log(555)
if (deleteMsg && delete_flag && res && res.data && res.data.message_id)
setTimeout(() => {
bot('delete_msg', {
message_id : res.data.message_id,
});
}, 60 * 1000);
})
.catch(err => {
console.error(`${new Date().toLocaleString()} [error] delete msg\n${err}`);
});
}
export default {pixivCheck}; |
wecab是绿色 |
只有111和222是吗,没到3? |
确实
|
那现在中间部分改成这样 async function checkImage(url, method = 'HEAD') {
console.log(22)
return axios({
url,
method
}).catch(err => {return err.response});
}
function imageCQcode(pic_id) {
return `[CQ:image,,cache=0,file=https://pixiv.cat/${pic_id}.jpg]`;
}
async function singleArtwork(pic_id, replyFunc, context, bot) {
console.log(21)
let payload = "";
let url = `https://pixiv.cat/${pic_id}.jpg`
let res = await checkImage(url, "GET");
let delete_flag = true;
console.log(333, res)
if (res.status == 404) {
if (/這個作品ID中有 (\d{1,2}) 張圖片/.test(res.data)) {
const num_img = parseInt(/這個作品ID中有 (\d{1,2}) 張圖片/.exec(res.data)[1]);
for (let i = 1; i < num_img + 1; i++) {
payload += imageCQcode(`${pic_id}-${i}`);
}
} |
|
emmmm, 你试试服务器直接访问 |
机子是上海腾讯云,梯子挂的香港腾讯云 |
|
啥时候能用上呢( |
可以将 |
发送看看p站+PID的时候机器人没有反应, 日志无任何输出
error-1.log中也找不到pixiv功能暂停的字样
其他功能都正常
梯子正常
The text was updated successfully, but these errors were encountered: