Temporary debugging+3
This commit is contained in:
1 parent
5e985c39de
commit
fd90cc2fed
1 file changed
+3
-1
+3
-1
@@ -3,6 +3,7 @@ import * as cheerio from 'cheerio';
|
||||
import { getCache, setCache, getConfig } from './cache.js';
|
||||
import { writeFileSync, unlinkSync } from 'fs';
|
||||
import chalk from 'chalk';
|
||||
import { tmpdir } from 'os';
|
||||
|
||||
// ─── 通用请求函数 ────────────────────────────────────────
|
||||
function fetchHtml(url, cookie = '') {
|
||||
@@ -158,7 +159,8 @@ async function searchJavdb(id) {
|
||||
const session = decodeURIComponent(config.session);
|
||||
|
||||
// 写成 Netscape 格式,curl 能正确解析
|
||||
const tmpFile = `/tmp/javinfo_cookie.txt`;
|
||||
// 兼容 Windows 和 Linux
|
||||
const tmpFile = `${tmpdir()}/javinfo_cookie.txt`;
|
||||
const netscapeCookie = [
|
||||
'# Netscape HTTP Cookie File',
|
||||
`javdb.com\tFALSE\t/\tTRUE\t0\t_jdb_session\t${session}`,
|
||||
|
||||
Reference in new issue
Block a user