feat: 重构解析器

This commit is contained in:
digua
2025-12-21 22:45:59 +08:00
parent 2e51a5c70d
commit 0d451ae29b
2 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ import type { FormatModule } from '../types'
// 导入所有格式模块
import chatlab from './chatlab'
import chatlabJsonl from './chatlab-jsonl'
import shuakamiQqExporterV4 from './shuakami-qq-exporter-v4'
import shuakamiQqExporter from './shuakami-qq-exporter'
import yccccccyEchotrace from './ycccccccy-echotrace'
import wechatDefault from './wechat-default'
import qqNativeTxt from './qq-native-txt'
@@ -19,11 +19,11 @@ import qqNativeTxt from './qq-native-txt'
export const formats: FormatModule[] = [
chatlab, // 优先级 1 - ChatLab JSON
chatlabJsonl, // 优先级 2 - ChatLab JSONL(流式格式,支持超大文件)
shuakamiQqExporterV4, // 优先级 10 - shuakami/qq-chat-exporter V4
shuakamiQqExporter, // 优先级 10 - shuakami/qq-chat-exporter
yccccccyEchotrace, // 优先级 15 - ycccccccy/echotrace 微信导出
wechatDefault, // 优先级 20 - 微信数据库导出 JSON
qqNativeTxt, // 优先级 30 - QQ 官方导出 TXT
]
// 按名称导出,方便单独使用
export { chatlab, chatlabJsonl, shuakamiQqExporterV4, yccccccyEchotrace, wechatDefault, qqNativeTxt }
export { chatlab, chatlabJsonl, shuakamiQqExporter, yccccccyEchotrace, wechatDefault, qqNativeTxt }
@@ -1,7 +1,7 @@
/**
* shuakami/qq-chat-exporter V4
* shuakami/qq-chat-exporter
* 适配项目: https://github.com/shuakami/qq-chat-exporter
* 版本: V4.x (202512)
* 版本: 通用 V4.x
*
*
* - metadata: 元数据
@@ -39,13 +39,13 @@ import { getFileSize, createProgress, readFileHeadBytes, parseTimestamp, isValid
// ==================== 特征定义 ====================
export const feature: FormatFeature = {
id: 'shuakami-qq-exporter-v4',
name: 'shuakami/qq-chat-exporter V4',
id: 'shuakami-qq-exporter',
name: 'shuakami/qq-chat-exporter',
platform: KNOWN_PLATFORMS.QQ,
priority: 10,
extensions: ['.json'],
signatures: {
head: [/QQChatExporter V4/, /"version"\s*:\s*"4\./],
head: [/QQChatExporter(?:\s+V\d+)?/, /"version"\s*:\s*"\d+\./],
requiredFields: ['metadata', 'chatInfo'],
},
}