javdict 1.2.11 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/README_de.md +12 -1
- package/{README_ja.md → README_jp.md} +12 -1
- package/{README_ko.md → README_kr.md} +12 -1
- package/README_zh.md +12 -1
- package/index.js +11 -4
- package/lib/display.js +19 -14
- package/lib/fetcher.js +2 -5
- package/lib/i18n.js +111 -0
- package/package.json +1 -1
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/AvDict.iml +0 -8
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
English | [中文](README_zh.md) | [日本語](
|
|
1
|
+
English | [中文](README_zh.md) | [日本語](README_jp.md) | [한국어](README_kr.md) | [Deutsch](README_de.md)
|
|
2
2
|
|
|
3
3
|
# AvDict 🎬
|
|
4
4
|
|
|
@@ -92,6 +92,16 @@ jav ABF-331
|
|
|
92
92
|
jav JUR-067
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
**Query with specific language output:**
|
|
96
|
+
```bash
|
|
97
|
+
jav --lang en SSIS-001 # English
|
|
98
|
+
jav --lang zh SSIS-001 # 中文
|
|
99
|
+
jav --lang jp SSIS-001 # 日本語
|
|
100
|
+
jav --lang kr SSIS-001 # 한국어
|
|
101
|
+
jav --lang de SSIS-001 # Deutsch
|
|
102
|
+
jav -l en SSIS-001 # shorthand
|
|
103
|
+
```
|
|
104
|
+
|
|
95
105
|
**Output raw JSON:**
|
|
96
106
|
|
|
97
107
|
```bash
|
|
@@ -128,6 +138,7 @@ Arguments:
|
|
|
128
138
|
|
|
129
139
|
Options:
|
|
130
140
|
-v, --version Print version number
|
|
141
|
+
-l, --lang <lang> Output language: zh/en/jp/kr/de (default: zh)
|
|
131
142
|
-r, --raw Output raw JSON instead of formatted display
|
|
132
143
|
--setup Configure JAVDB Cookie (optional, improves coverage)
|
|
133
144
|
--clear-cache Clear local result cache
|
package/README_de.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[English](README.md) | [中文](README_zh.md) | [日本語](
|
|
1
|
+
[English](README.md) | [中文](README_zh.md) | [日本語](README_jp.md) | [한국어](README_kr.md) | Deutsch
|
|
2
2
|
|
|
3
3
|
# AvDict 🎬
|
|
4
4
|
|
|
@@ -94,6 +94,16 @@ jav ABF-331
|
|
|
94
94
|
jav JUR-067
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
**Ausgabe in bestimmter Sprache:**
|
|
98
|
+
```bash
|
|
99
|
+
jav --lang de SSIS-001 # Deutsch
|
|
100
|
+
jav --lang zh SSIS-001 # 中文
|
|
101
|
+
jav --lang en SSIS-001 # English
|
|
102
|
+
jav --lang jp SSIS-001 # 日本語
|
|
103
|
+
jav --lang kr SSIS-001 # 한국어
|
|
104
|
+
jav -l de SSIS-001 # Kurzform
|
|
105
|
+
```
|
|
106
|
+
|
|
97
107
|
**Rohdaten als JSON ausgeben:**
|
|
98
108
|
|
|
99
109
|
```bash
|
|
@@ -130,6 +140,7 @@ Arguments:
|
|
|
130
140
|
|
|
131
141
|
Options:
|
|
132
142
|
-v, --version Versionsnummer ausgeben
|
|
143
|
+
-l, --lang <Sprache> Ausgabesprache: zh/en/jp/kr/de (Standard: zh)
|
|
133
144
|
-r, --raw Ausgabe als rohes JSON
|
|
134
145
|
--setup JAVDB Cookie konfigurieren(optional, verbessert Abdeckung)
|
|
135
146
|
--clear-cache Lokalen Cache leeren
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[English](README.md) | [中文](README_zh.md) | 日本語 | [한국어](
|
|
1
|
+
[English](README.md) | [中文](README_zh.md) | 日本語 | [한국어](README_kr.md) | [Deutsch](README_de.md)
|
|
2
2
|
|
|
3
3
|
# AvDict 🎬
|
|
4
4
|
|
|
@@ -94,6 +94,16 @@ jav ABF-331
|
|
|
94
94
|
jav JUR-067
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
**言語を指定して出力:**
|
|
98
|
+
```bash
|
|
99
|
+
jav --lang jp SSIS-001 # 日本語(デフォルト設定時)
|
|
100
|
+
jav --lang zh SSIS-001 # 中文
|
|
101
|
+
jav --lang en SSIS-001 # English
|
|
102
|
+
jav --lang kr SSIS-001 # 한국어
|
|
103
|
+
jav --lang de SSIS-001 # Deutsch
|
|
104
|
+
jav -l ja SSIS-001 # 省略形
|
|
105
|
+
```
|
|
106
|
+
|
|
97
107
|
**生の JSON データで出力:**
|
|
98
108
|
|
|
99
109
|
```bash
|
|
@@ -130,6 +140,7 @@ Arguments:
|
|
|
130
140
|
|
|
131
141
|
Options:
|
|
132
142
|
-v, --version バージョンを表示
|
|
143
|
+
-l, --lang <言語> 出力言語:zh/en/jp/kr/de(デフォルト:zh)
|
|
133
144
|
-r, --raw 生の JSON 形式で出力
|
|
134
145
|
--setup JAVDB Cookie を設定(任意、カバレッジ向上)
|
|
135
146
|
--clear-cache ローカルキャッシュを削除
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[English](README.md) | [中文](README_zh.md) | [日本語](
|
|
1
|
+
[English](README.md) | [中文](README_zh.md) | [日本語](README_jp.md) | 한국어 | [Deutsch](README_de.md)
|
|
2
2
|
|
|
3
3
|
# AvDict 🎬
|
|
4
4
|
|
|
@@ -94,6 +94,16 @@ jav ABF-331
|
|
|
94
94
|
jav JUR-067
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
**언어를 지정하여 출력:**
|
|
98
|
+
```bash
|
|
99
|
+
jav --lang kr SSIS-001 # 한국어
|
|
100
|
+
jav --lang zh SSIS-001 # 中文
|
|
101
|
+
jav --lang en SSIS-001 # English
|
|
102
|
+
jav --lang jp SSIS-001 # 日本語
|
|
103
|
+
jav --lang de SSIS-001 # Deutsch
|
|
104
|
+
jav -l ko SSIS-001 # 축약형
|
|
105
|
+
```
|
|
106
|
+
|
|
97
107
|
**원시 JSON 출력:**
|
|
98
108
|
|
|
99
109
|
```bash
|
|
@@ -130,6 +140,7 @@ Arguments:
|
|
|
130
140
|
|
|
131
141
|
Options:
|
|
132
142
|
-v, --version 버전 출력
|
|
143
|
+
-l, --lang <언어> 출력 언어: zh/en/jp/kr/de (기본값: zh)
|
|
133
144
|
-r, --raw 원시 JSON 형식으로 출력
|
|
134
145
|
--setup JAVDB Cookie 설정(선택, 커버리지 향상)
|
|
135
146
|
--clear-cache 로컬 캐시 삭제
|
package/README_zh.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[English](README.md) | 中文 | [日本語](
|
|
1
|
+
[English](README.md) | 中文 | [日本語](README_jp.md) | [한국어](README_kr.md) | [Deutsch](README_de.md)
|
|
2
2
|
|
|
3
3
|
# AvDict 🎬
|
|
4
4
|
|
|
@@ -94,6 +94,16 @@ jav ABF-331
|
|
|
94
94
|
jav JUR-067
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
**指定语言输出:**
|
|
98
|
+
```bash
|
|
99
|
+
jav --lang zh SSIS-001 # 中文(默认)
|
|
100
|
+
jav --lang en SSIS-001 # English
|
|
101
|
+
jav --lang jp SSIS-001 # 日本語
|
|
102
|
+
jav --lang kr SSIS-001 # 한국어
|
|
103
|
+
jav --lang de SSIS-001 # Deutsch
|
|
104
|
+
jav -l en SSIS-001 # 缩写
|
|
105
|
+
```
|
|
106
|
+
|
|
97
107
|
**输出原始 JSON 数据:**
|
|
98
108
|
|
|
99
109
|
```bash
|
|
@@ -130,6 +140,7 @@ Arguments:
|
|
|
130
140
|
|
|
131
141
|
Options:
|
|
132
142
|
-v, --version 显示版本号
|
|
143
|
+
-l, --lang <语言> 输出语言:zh/en/jp/kr/de(默认:zh)
|
|
133
144
|
-r, --raw 以原始 JSON 格式输出结果
|
|
134
145
|
--setup 配置 JAVDB Cookie(可选,提高覆盖率)
|
|
135
146
|
--clear-cache 清空本地缓存
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { display } from './lib/display.js';
|
|
|
8
8
|
import { clearCache, setConfig } from './lib/cache.js';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import chalk from 'chalk';
|
|
11
|
+
import { getLang } from './lib/i18n.js';
|
|
11
12
|
|
|
12
13
|
const require = createRequire(import.meta.url);
|
|
13
14
|
const pkg = require('./package.json');
|
|
@@ -20,6 +21,7 @@ program
|
|
|
20
21
|
.option('-r, --raw', '显示原始详细数据')
|
|
21
22
|
.option('--clear-cache', '清空本地缓存')
|
|
22
23
|
.option('--setup', '配置JAVDB Cookie(可选,提高查询覆盖率)')
|
|
24
|
+
.option('-l, --lang <lang>', '显示语言 zh/en/jp/kr/de', 'zh')
|
|
23
25
|
.action(async (id, options) => {
|
|
24
26
|
|
|
25
27
|
if (options.setup) {
|
|
@@ -63,21 +65,26 @@ program
|
|
|
63
65
|
process.exit(0);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
const
|
|
68
|
+
const t = getLang(options.lang || 'zh');
|
|
69
|
+
const spinner = ora(`${t.searching} ${id.toUpperCase()} ...`).start();
|
|
67
70
|
|
|
68
71
|
try {
|
|
69
72
|
const result = await search(id.toUpperCase());
|
|
70
73
|
spinner.stop();
|
|
71
74
|
|
|
72
75
|
if (!result) {
|
|
73
|
-
console.log(chalk.red(`\n
|
|
76
|
+
console.log(chalk.red(`\n${t.notFound}: ${id.toUpperCase()}`));
|
|
77
|
+
// Windows 用户提示
|
|
78
|
+
if (process.platform === 'win32') {
|
|
79
|
+
process.stderr.write(chalk.gray(` ${t.windowsHint}\n`));
|
|
80
|
+
}
|
|
74
81
|
process.exit(1);
|
|
75
82
|
}
|
|
76
83
|
|
|
77
|
-
display(result, options.raw);
|
|
84
|
+
display(result, options.raw, options.lang || 'zh');
|
|
78
85
|
} catch (err) {
|
|
79
86
|
spinner.stop();
|
|
80
|
-
console.error(
|
|
87
|
+
console.error(`\n${t.queryFailed}:`, err.message);
|
|
81
88
|
process.exit(1);
|
|
82
89
|
}
|
|
83
90
|
});
|
package/lib/display.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
+
import { getLang } from './i18n.js';
|
|
2
3
|
|
|
3
4
|
const DIVIDER = chalk.gray('─'.repeat(60));
|
|
4
5
|
|
|
5
6
|
function row(label, value, color = chalk.white) {
|
|
6
7
|
if (!value || (Array.isArray(value) && value.length === 0)) return;
|
|
7
|
-
const paddedLabel = chalk.cyan(label.padEnd(8, ' '));
|
|
8
|
+
const paddedLabel = chalk.cyan(label.padEnd(8, ' '));
|
|
8
9
|
console.log(` ${paddedLabel} ${color(value)}`);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export function display(info, raw = false) {
|
|
12
|
+
export function display(info, raw = false, lang = 'zh') {
|
|
12
13
|
if (raw) {
|
|
13
14
|
console.log(JSON.stringify(info, null, 2));
|
|
14
15
|
return;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
const t = getLang(lang);
|
|
19
|
+
|
|
17
20
|
console.log('');
|
|
18
21
|
console.log(DIVIDER);
|
|
19
22
|
console.log(
|
|
@@ -29,27 +32,29 @@ export function display(info, raw = false) {
|
|
|
29
32
|
|
|
30
33
|
console.log(DIVIDER);
|
|
31
34
|
|
|
32
|
-
row(
|
|
33
|
-
row(
|
|
34
|
-
row(
|
|
35
|
-
row(
|
|
36
|
-
row(
|
|
37
|
-
row(
|
|
38
|
-
row(
|
|
39
|
-
row(
|
|
35
|
+
row(t.actress, info.actresses.join(' / '), chalk.magenta);
|
|
36
|
+
row(t.actor, info.actors.join(' / '), chalk.blue);
|
|
37
|
+
row(t.releaseDate, info.releaseDate, chalk.green);
|
|
38
|
+
row(t.duration, info.duration);
|
|
39
|
+
row(t.studio, info.studio, chalk.yellow);
|
|
40
|
+
row(t.label, info.label);
|
|
41
|
+
row(t.director, info.director);
|
|
42
|
+
row(t.series, info.series);
|
|
43
|
+
row(t.rating, info.score ? `${info.score}${info.scoreCount ? `(${info.scoreCount})` : ''}` : '', chalk.yellow);
|
|
44
|
+
row(t.wishlist, info.wantCount ? `${info.wantCount}` : '', chalk.cyan);
|
|
40
45
|
|
|
41
46
|
if (info.tags.length > 0) {
|
|
42
|
-
const tagStr = info.tags.map(
|
|
43
|
-
console.log(' ' + chalk.cyan('
|
|
47
|
+
const tagStr = info.tags.map(tag => chalk.bgGray(` ${tag} `)).join(' ');
|
|
48
|
+
console.log(' ' + chalk.cyan(t.tags.padEnd(8, ' ')) + ' ' + tagStr);
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
if (info.coverUrl) {
|
|
47
52
|
console.log('');
|
|
48
|
-
console.log(' ' + chalk.cyan('
|
|
53
|
+
console.log(' ' + chalk.cyan(t.cover.padEnd(8, ' ')) + ' ' + chalk.underline.gray(info.coverUrl));
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
if (info.source) {
|
|
52
|
-
console.log(' ' + chalk.gray(
|
|
57
|
+
console.log(' ' + chalk.gray(`${t.source}: ${info.source}`));
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
console.log(DIVIDER);
|
package/lib/fetcher.js
CHANGED
|
@@ -279,6 +279,8 @@ function parseJavdb(html, queryId) {
|
|
|
279
279
|
tags: [],
|
|
280
280
|
coverUrl: $('.video-cover img').attr('src') || '',
|
|
281
281
|
score: $('.score .value').first().text().trim(),
|
|
282
|
+
scoreCount: ($('.score .value').first().text().match(/由(\d+)人/) || [])[1] || '',
|
|
283
|
+
wantCount: ($('.panel-block:last .is-size-7').text().match(/(\d+)人想看/) || [])[1] || '',
|
|
282
284
|
};
|
|
283
285
|
|
|
284
286
|
$('.movie-panel-info .panel-block').each((_, el) => {
|
|
@@ -358,10 +360,5 @@ export async function search(id) {
|
|
|
358
360
|
}
|
|
359
361
|
}
|
|
360
362
|
|
|
361
|
-
// Windows 用户提示
|
|
362
|
-
if (process.platform === 'win32') {
|
|
363
|
-
process.stderr.write(chalk.gray(' 温馨提示: 此车牌号需要JAVDB数据源,Windows暂不支持~\n'));
|
|
364
|
-
}
|
|
365
|
-
|
|
366
363
|
return null;
|
|
367
364
|
}
|
package/lib/i18n.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
zh: {
|
|
3
|
+
actress: '女优',
|
|
4
|
+
actor: '男优',
|
|
5
|
+
releaseDate: '发售日期',
|
|
6
|
+
duration: '时长',
|
|
7
|
+
studio: '制作商',
|
|
8
|
+
label: '发行商',
|
|
9
|
+
director: '导演',
|
|
10
|
+
series: '系列',
|
|
11
|
+
rating: '评分',
|
|
12
|
+
wishlist: '想看',
|
|
13
|
+
tags: '类别',
|
|
14
|
+
cover: '封面',
|
|
15
|
+
source: '数据来源',
|
|
16
|
+
searching: '正在查询',
|
|
17
|
+
notFound: '未找到番号',
|
|
18
|
+
queryFailed: '查询失败',
|
|
19
|
+
cacheCleared: '缓存已清空',
|
|
20
|
+
fc2Detected: 'FC2番号已转换为',
|
|
21
|
+
windowsHint: '温馨提示: 此番号需要JAVDB数据源,Windows暂不支持~',
|
|
22
|
+
},
|
|
23
|
+
en: {
|
|
24
|
+
actress: 'Actress',
|
|
25
|
+
actor: 'Actor',
|
|
26
|
+
releaseDate: 'Released',
|
|
27
|
+
duration: 'Duration',
|
|
28
|
+
studio: 'Studio',
|
|
29
|
+
label: 'Label',
|
|
30
|
+
director: 'Director',
|
|
31
|
+
series: 'Series',
|
|
32
|
+
rating: 'Rating',
|
|
33
|
+
wishlist: 'Wishlist',
|
|
34
|
+
tags: 'Tags',
|
|
35
|
+
cover: 'Cover',
|
|
36
|
+
source: 'Source',
|
|
37
|
+
searching: 'Searching',
|
|
38
|
+
notFound: 'Title not found',
|
|
39
|
+
queryFailed: 'Query failed',
|
|
40
|
+
cacheCleared: 'Cache cleared',
|
|
41
|
+
fc2Detected: 'FC2 format detected',
|
|
42
|
+
windowsHint: 'Note: This title requires JAVDB, which is unavailable on Windows.',
|
|
43
|
+
},
|
|
44
|
+
jp: {
|
|
45
|
+
actress: '女優',
|
|
46
|
+
actor: '男優',
|
|
47
|
+
releaseDate: '発売日',
|
|
48
|
+
duration: '時間',
|
|
49
|
+
studio: 'メーカー',
|
|
50
|
+
label: 'レーベル',
|
|
51
|
+
director: '監督',
|
|
52
|
+
series: 'シリーズ',
|
|
53
|
+
rating: '評価',
|
|
54
|
+
wishlist: '観たい',
|
|
55
|
+
tags: 'カテゴリ',
|
|
56
|
+
cover: 'カバー',
|
|
57
|
+
source: 'データソース',
|
|
58
|
+
searching: '検索中',
|
|
59
|
+
notFound: '番号が見つかりません',
|
|
60
|
+
queryFailed: '検索失敗',
|
|
61
|
+
cacheCleared: 'キャッシュを削除しました',
|
|
62
|
+
fc2Detected: 'FC2番号を変換しました',
|
|
63
|
+
windowsHint: '注意: この番号はJAVDBが必要ですが、WindowsではJAVDBが利用できません。',
|
|
64
|
+
},
|
|
65
|
+
kr: {
|
|
66
|
+
actress: '여배우',
|
|
67
|
+
actor: '남배우',
|
|
68
|
+
releaseDate: '발매일',
|
|
69
|
+
duration: '시간',
|
|
70
|
+
studio: '제작사',
|
|
71
|
+
label: '레이블',
|
|
72
|
+
director: '감독',
|
|
73
|
+
series: '시리즈',
|
|
74
|
+
rating: '평점',
|
|
75
|
+
wishlist: '보고싶어요',
|
|
76
|
+
tags: '카테고리',
|
|
77
|
+
cover: '커버',
|
|
78
|
+
source: '데이터 출처',
|
|
79
|
+
searching: '검색 중',
|
|
80
|
+
notFound: '번호를 찾을 수 없습니다',
|
|
81
|
+
queryFailed: '검색 실패',
|
|
82
|
+
cacheCleared: '캐시가 삭제되었습니다',
|
|
83
|
+
fc2Detected: 'FC2 번호 변환됨',
|
|
84
|
+
windowsHint: '알림: 이 번호는 JAVDB가 필요하지만 Windows에서는 사용할 수 없습니다.',
|
|
85
|
+
},
|
|
86
|
+
de: {
|
|
87
|
+
actress: 'Darstellerin',
|
|
88
|
+
actor: 'Darsteller',
|
|
89
|
+
releaseDate: 'Erscheinungsdatum',
|
|
90
|
+
duration: 'Laufzeit',
|
|
91
|
+
studio: 'Studio',
|
|
92
|
+
label: 'Label',
|
|
93
|
+
director: 'Regisseur',
|
|
94
|
+
series: 'Serie',
|
|
95
|
+
rating: 'Bewertung',
|
|
96
|
+
wishlist: 'Merkliste',
|
|
97
|
+
tags: 'Kategorien',
|
|
98
|
+
cover: 'Cover',
|
|
99
|
+
source: 'Datenquelle',
|
|
100
|
+
searching: 'Suche läuft',
|
|
101
|
+
notFound: 'Titel nicht gefunden',
|
|
102
|
+
queryFailed: 'Suche fehlgeschlagen',
|
|
103
|
+
cacheCleared: 'Cache geleert',
|
|
104
|
+
fc2Detected: 'FC2-Format erkannt',
|
|
105
|
+
windowsHint: 'Hinweis: Dieser Titel benötigt JAVDB, das unter Windows nicht verfügbar ist.',
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export function getLang(lang) {
|
|
110
|
+
return messages[lang] || messages.zh; // 默认中文
|
|
111
|
+
}
|
package/package.json
CHANGED
package/.idea/misc.xml
DELETED
package/.idea/modules.xml
DELETED
package/.idea/vcs.xml
DELETED
package/AvDict.iml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="GENERAL_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|