Code Monkey home page Code Monkey logo

wechat-export's Introduction

wechat-export

Export WeChat chat histories to HTML files.

Preview

This script generates a HTML file for each contact's chat history.

Currently it supports:

  • Text
  • Voice
  • Picture
  • Video
  • System message

TODO:

  • Emoji
  • Link

How to Use

Tested on macOS 11.5.2 and iOS 14.8, but should work on any recent versions.

  1. Back up iPhone with your Mac.

  2. Use iExplore to export "Documents" to the local system.

  3. Clone the code.

  4. Compile the audio decoder: cd silk/silk && make && cd ../../

  5. Install Node.js (>= 14)>

  6. npm install

  7. node index.js path_to/Documents/{uid} output_dir (path_to/Documents is what we got from the second step, and uid looks like g3c3814a370neh4dr69uf9f889f6ea7a).

Articles

Related Projects

Credits

Silk decoder is developed by Karl Chen.

wechat-export's People

Contributors

luin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

wechat-export's Issues

User/group names are missed

Great job!

I ran into a problem here.
Data exported successfully, but most chatting folders (90%) are named with a hash-strinig rather than the nickname or noted name or chatting group name.
I tried twice, it came out the same like:

outdir/[nickname]
outdir/[noted name]
outdir/69f90c8e57097c8bc6bc6f19789ca7c0
outdir/71f90c8e57097c8bc6bc6f19789ca7c0
outdir/98f90c8e57097c8bc6bc6f19789ca7c0

I don't know whether it's a bug/issue or feature.

MacOS 11.6, exported with iExplorer 4.5.0
Nodejs 16.14.0, npm 8.3.1

Again, thanks to your great job!

Cannot find module 'output/{uid}/message.json'

I followed the instruction in README and got the following message:

> node index.js bkup/Documents/{uid} output/
โœ… Got 4 message files from bkup/Documents/{uid}/DB
node:internal/modules/cjs/loader:939
  const err = new Error(message);
              ^

Error: Cannot find module 'output/246axxxxxxxxxxxxxxxxxxxxf11947/message.json'
Require stack:
- /Users/admin/Downloads/wechat-export-main/utils/generateHTMLFromJSON.js
- /Users/admin/Downloads/wechat-export-main/utils/parseMessages.js
- /Users/admin/Downloads/wechat-export-main/utils/parseDatabase.js
- /Users/admin/Downloads/wechat-export-main/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at Module._load (node:internal/modules/cjs/loader:780:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at generateHTMLFromJSON (/Users/admin/Downloads/wechat-export-main/utils/generateHTMLFromJSON.js:12:16)
    at parseMessages (/Users/admin/Downloads/wechat-export-main/utils/parseMessages.js:157:9)
    at async map.concurrency (/Users/admin/Downloads/wechat-export-main/utils/parseDatabase.js:25:7)
    at async /Users/admin/Downloads/wechat-export-main/node_modules/p-map/index.js:57:22 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/admin/Downloads/wechat-export-main/utils/generateHTMLFromJSON.js',
    '/Users/admin/Downloads/wechat-export-main/utils/parseMessages.js',
    '/Users/admin/Downloads/wechat-export-main/utils/parseDatabase.js',
    '/Users/admin/Downloads/wechat-export-main/index.js'
  ]
}

Node.js v18.2.0

Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.