Fix: Decoding cookies to solve the 403 error of Axios secondary encoding.

This commit is contained in:
Unknow committed 2026-03-20 20:39:59 +08:00
1 parent 10d899f2b3
commit df68291483
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -4,6 +4,9 @@ import { getCache, setCache } from './cache.js';
const BASE_URL = 'https://javdb.com';
// 把 _jdb_session 的值解码
const SESSION = decodeURIComponent('wJkH2678EN3cZzzL2Pqbyr158quff0CaGzuh5hRxUXXADcKOQm1zKdOnlwow3wDfL5AX2NeKne52BgUZT6JpBGp5prKgUmKyBReopEABv30rItmWnxowjJ04Mki%2BO0jQ3OO%2F4F2BYE7TTZ8GlgpA3kuesTAsX8bAcL0HqWF4LDRdMeo9JYqzDn%2FoPAUFxnmwXBieXtMXqCP8JnudI2vQ44jtIhFRvSrzf832gRMi7STwMG7K8O9%2BH3AoJfMKbuBomnLMFuBNBbPbB3SShbi3SBja8bX8nudBILUX0ZiJtD%2FEOl%2BN3r6dVPw5--do%2Bi7mvLi5xyZ0HZ--gZT%2Fl7%2BX9Vr3GjRNK7FXOw%3D%3D');
const HEADERS = {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' +
@@ -19,7 +22,7 @@ const HEADERS = {
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
'Cache-Control': 'max-age=0',
Cookie: 'list_mode=h; theme=auto; locale=zh; over18=1; _jdb_session=wJkH2678EN3cZzzL2Pqbyr158quff0CaGzuh5hRxUXXADcKOQm1zKdOnlwow3wDfL5AX2NeKne52BgUZT6JpBGp5prKgUmKyBReopEABv30rItmWnxowjJ04Mki%2BO0jQ3OO%2F4F2BYE7TTZ8GlgpA3kuesTAsX8bAcL0HqWF4LDRdMeo9JYqzDn%2FoPAUFxnmwXBieXtMXqCP8JnudI2vQ44jtIhFRvSrzf832gRMi7STwMG7K8O9%2BH3AoJfMKbuBomnLMFuBNBbPbB3SShbi3SBja8bX8nudBILUX0ZiJtD%2FEOl%2BN3r6dVPw5--do%2Bi7mvLi5xyZ0HZ--gZT%2Fl7%2BX9Vr3GjRNK7FXOw%3D%3D', // over18=1 跳过成人内容确认页
Cookie: `list_mode=h; theme=auto; locale=zh; over18=1; _jdb_session=${SESSION}`, // over18=1 跳过成人内容确认页
};
async function fetchHtml(url) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "javinfo",
"version": "1.0.2",
"version": "1.0.3",
"description": "AV番号命令行查询工具",
"main": "./index.js",
"type": "module",