mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-20 21:30:28 +08:00
feat: 重构解析器
This commit is contained in:
@@ -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 }
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* shuakami/qq-chat-exporter V4 格式解析器
|
||||
* shuakami/qq-chat-exporter 格式解析器
|
||||
* 适配项目: https://github.com/shuakami/qq-chat-exporter
|
||||
* 版本: V4.x (2025年12月更新)
|
||||
* 版本: 通用(支持 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'],
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user