Compare commits
2 Commits
c4d55ec6c7
...
175a86b490
Author | SHA1 | Date | |
---|---|---|---|
175a86b490 | |||
8f1c789c8e |
10
index.js
10
index.js
@ -56,12 +56,12 @@ async function serveId(id, req, res, next) {
|
||||
if (!url) return res.status(400).type("text").send(`size must be one of the following: ${Object.keys(pages[0].urls).join(', ')}`);
|
||||
|
||||
var pxreq = await fetch(url, { headers: {"Referer": "https://www.pixiv.net"} });
|
||||
if (pxreq.status != 200 && size == "original") {
|
||||
res.header("X-Using-Backup", '1');
|
||||
pxreq = await fetch(`https://39.hmbp.gq/https://www.pixiv.net/en/artworks/${id}?noredirect`);
|
||||
}
|
||||
//if (pxreq.status != 200 && size == "original") {
|
||||
// res.header("X-Using-Backup", '1');
|
||||
// pxreq = await fetch(`https://39.hmbp.gq/https://www.pixiv.net/en/artworks/${id}?noredirect`);
|
||||
//}
|
||||
|
||||
res.status(203);
|
||||
res.status(pxreq.status);
|
||||
res.type(pxreq.headers.get("Content-Type"));
|
||||
res.header("Content-Disposition", `filename=${url.split('/').pop()}`);
|
||||
res.header("X-Pixiv-Id", id);
|
||||
|
665
package-lock.json
generated
665
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user