From fd90cc2fedbb93efa6594c5d76a247dbe9dce15f Mon Sep 17 00:00:00 2001 From: gdjdkid <67935269+gdjdkid@users.noreply.github.com> Date: Sat, 21 Mar 2026 15:29:13 +0800 Subject: [PATCH] Temporary debugging+3 --- lib/fetcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fetcher.js b/lib/fetcher.js index ecf485a..35e5025 100644 --- a/lib/fetcher.js +++ b/lib/fetcher.js @@ -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}`,