Fix: Solving FC2 format conversion logic problems
This commit is contained in:
1 parent
f745d5b799
commit
aca5e6dda6
2 files changed
+4
-11
No files matched your search
+3
-10
@@ -172,13 +172,6 @@ function searchJavdb(id) {
|
||||
{ shell: '/bin/bash', timeout: 15000, maxBuffer: 1024 * 1024 * 10 }
|
||||
).toString();
|
||||
|
||||
// 加这几行调试
|
||||
console.error('搜索HTML长度:', searchHtml.length);
|
||||
const allItems = searchHtml.match(/class="box"/g);
|
||||
console.error('找到box元素数量:', allItems?.length || 0);
|
||||
const allStrong = searchHtml.match(/<strong>[^<]+<\/strong>/g);
|
||||
console.error('找到strong元素:', allStrong?.slice(0,5));
|
||||
|
||||
const $ = cheerio.load(searchHtml);
|
||||
let detailPath = null;
|
||||
|
||||
@@ -206,7 +199,6 @@ function searchJavdb(id) {
|
||||
|
||||
return parseJavdb(detailHtml, id);
|
||||
} catch {
|
||||
console.error('JAVDB查询错误:', e.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -271,9 +263,10 @@ function parseJavdb(html, queryId) {
|
||||
|
||||
// ─── 主入口:依次尝试三个数据源 ─────────────────────────
|
||||
export async function search(id) {
|
||||
// 自动识别 FC2 格式:031926_100 → FC2-031926
|
||||
// 自动识别:FC2 格式 031926_100 → 031926-100(JAVDB的FC2格式)
|
||||
if (/^\d{5,6}_\d+$/.test(id)) {
|
||||
id = `FC2-${id.split('_')[0]}`;
|
||||
const parts = id.split('_');
|
||||
id = `${parts[0]}-${parts[1]}`;
|
||||
console.log(chalk.gray(` FC2番号已转换为: ${id}`));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "javinfo",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"description": "AV番号命令行查询工具",
|
||||
"main": "./index.js",
|
||||
"type": "module",
|
||||
|
||||
Reference in new issue
Block a user