-
Notifications
You must be signed in to change notification settings - Fork 56
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
用github的peges功能构建后发现图片无法显示 #43
Comments
是的,演示使用的图片代理地址有防盗链,可以自行搭建代理服务 |
项目的地址能否发给我,谢谢大佬! |
可以搜 cloudflare workers pixiv 关键词,网上有很多文章 const ALLOWEDREFERERS = [
"lab.getloli.com",
"localhost:3000",
"localhost:8080",
"www.pixiv.net",
]
addEventListener("fetch", event => {
event.respondWith(imgProxy(event));
});
async function imgProxy(event) {
//Begin
let referer = event.request.headers.get("referer");
if (referer) {
let verified = false;
for (let i = 0; i < ALLOWEDREFERERS.length; i++) {
if (referer.includes(ALLOWEDREFERERS[i])) {
verified = true;
break;
}
}
if (!verified) {
return new Response('403 Forbidden', { status: 403, statusText: 'Forbidden' })
}
}
//End
let url = new URL(event.request.url);
url.hostname = "i.pximg.net";
let request = new Request(url, event.request);
return fetch(request, {
headers: {
'Referer': 'https://www.pixiv.net/'
}
})
} |
感谢大佬! |
对了反代理搭好后还需要修改哪里才能让图片显示出来呢?大佬! |
https://github.com/journey-ad/pixiv-viewer/blob/master/src/api/index.js#L19 |
|
api 访问可能有些不稳定,现在已经恢复了,用的这个项目,可以自己搭一个 |
图搜图的API有项目地址吗!大佬! |
这个是对 saucenao.com 的封装,自己实现一下吧 |
大佬那个 https://hibiapi.getloli.com/ |
https://pixiv.yourworld.fun/#/home
请问图片是开了反盗链吗.....
希望开发者能回应我!感谢!
The text was updated successfully, but these errors were encountered: