BlueMatthew / WechatExporter

Wechat Chat History Exporter 微信聊天记录导出备份程序
GNU General Public License v2.0
6.24k stars 564 forks source link

能否开发一个命令行版本 #71

Closed adyliu closed 2 years ago

adyliu commented 2 years ago

这样方便定时自动导出。当然如果能sdk也可以。

BlueMatthew commented 2 years ago

windows or mac?

adyliu commented 2 years ago

mac版本吧

BlueMatthew commented 2 years ago

我做了一个版本,简单测试了一下,你试试看有没有问题。

void printHelp(const char *executableName) { std::cout << "Usage: " << executableName << " [OPTION]\n" "Export Wechat chat history based on the options given:\n" " --backup=PATH Specify the directory of iTunes Backup\n" " --output=PATH Specify the directory in that Wechat chat history will be exported.\n" " --format=FORMAT FORMAT may be one of 'html', 'text'. 'html' is default.\n" " --account=ACCOUNT Specify the WeChat account which will be exported.\n" " --session=SESSION Specify the sessions which will be exported. May be specified multiple times\n" " If no session is specified, all sessions of the account will be exported.\n" " --asyncloading=[HTML LOADING OPTION]\n" " [HTML LOADING OPTION] may be one of 'sync', 'onscroll', 'oninit'. 'onscroll' is default.\n" " --filter=FILTER FILTER may be one of 'no', 'yes'. 'no' is default.\n" " --help Show this help.\n" << std::endl; }

adyliu commented 2 years ago

非常棒,功能上可用,可以导出。有一些小建议

  1. 有个小问题是,找动态库是当前目录的../Frameworks,我建立软链接后可用。
  2. 可以默认读取backup目录么,第一次用有点懵,看着ui界面选择的地址?例如 /Users/xxx/Library/Application\ Support/MobileSync/Backup/0000xxxxx
  3. 参数注释可以完善下,例如 --account是微信名称,--session是个人或者群名称。

最后希望能持续维护,或者开放下源码,感谢感谢。

➜ ~/Downloads/export-cmd $ ./WechatExporterCmd
dyld[20055]: Library not loaded: @executable_path/../Frameworks/libusbmuxd-2.0.6.dylib
  Referenced from: /Users/xxx/Downloads/export-cmd/WechatExporterCmd
  Reason: tried: '/Users/xxx/Downloads/export-cmd/../Frameworks/libusbmuxd-2.0.6.dylib' (no such file), '/usr/lib/libusbmuxd-2.0.6.dylib' (no such file)
Abort trap: 6
BlueMatthew commented 2 years ago
  1. 我今天传的1.9.4.0已经修改了动态库的引用路径为当前目录下的Frameworks,你是运行的这个版本吗?
  2. 默认路径我晚点看看。
  3. github上代码基本是所有解析微信聊天记录的代码了,如果要进一步开发,应该都没有问题了。后续有一些微调的代码,我没有commit上来。程序应该会持续更新。
adyliu commented 2 years ago
  1. 我今天传的1.9.4.0已经修改了动态库的引用路径为当前目录下的Frameworks,你是运行的这个版本吗?

1.9.4.0版本貌似我运行不了

➜ ~/Downloads/export $ ./WechatExporterCmd --help
Killed: 9
Gsmlvdeshui commented 2 years ago

有win的cmd版本吗

BlueMatthew commented 2 years ago
  1. 我今天传的1.9.4.0已经修改了动态库的引用路径为当前目录下的Frameworks,你是运行的这个版本吗?

1.9.4.0版本貌似我运行不了

➜ ~/Downloads/export $ ./WechatExporterCmd --help
Killed: 9

我再研究一下

BlueMatthew commented 2 years ago

有win的cmd版本吗

好,后面我改一下成windows的版本

BlueMatthew commented 2 years ago

1.9.5.4 win/macos命令行都有了。

BlueMatthew commented 2 years ago

命令行程序已经提供,关闭本issue,命令行如果有问题,可以再开issue。