feat: 更新角色数据,优化表格获取方法,多语言别名匹配更正,图片获取改 Curl 形式
This commit is contained in:
@@ -12,8 +12,10 @@ const {
|
||||
const LANGUAGE_ALIASES = {
|
||||
english: 'en',
|
||||
'chinese simplified': 'zh-Hans',
|
||||
'chinese (simplified)': 'zh-Hans',
|
||||
'chinese s': 'zh-Hans',
|
||||
'chinese traditional': 'zh-Hant',
|
||||
'chinese (traditional)': 'zh-Hant',
|
||||
'chinese t': 'zh-Hant',
|
||||
japanese: 'ja',
|
||||
korean: 'ko',
|
||||
@@ -219,7 +221,9 @@ function parseOtherLanguages(html) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const $table = $heading.nextAll('table').first();
|
||||
// 标题后可能直接是表格,也可能是包了多张表的 div,只取文档顺序里的第一张
|
||||
const $following = $heading.nextAll();
|
||||
const $table = $following.filter('table').add($following.find('table')).first();
|
||||
if (!$table.length) {
|
||||
return {};
|
||||
}
|
||||
@@ -343,6 +347,7 @@ async function collectCharacterData(config, images, nameTransform) {
|
||||
buildParseApiUrl(siteOrigin, wikiTitle),
|
||||
config.name
|
||||
);
|
||||
console.log('html', buildParseApiUrl(siteOrigin, wikiTitle));
|
||||
const names = parseOtherLanguages(html);
|
||||
const region =
|
||||
parseRegionFromInfobox(html, regionSelector) || existing.region;
|
||||
|
||||
Reference in New Issue
Block a user