GithubHelp home page GithubHelp logo

tuomassalo / signal-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carderne/signal-export

1.0 1.0 0.0 218 KB

Export your Signal chats to markdown files with attachments

License: Other

Python 92.37% CSS 5.55% Dockerfile 2.08%

signal-export's Introduction

signal-export

docker-build

Export chats from the Signal Desktop app to Markdown and HTML files with attachments. Each chat is exported as an individual .md/.html file and the attachments for each are stored in a separate folder. Attachments are linked from the Markdown files and displayed in the HTML (pictures, videos, voice notes).

Currently this seems to be the only way to get chat history out of Signal!

Adapted from https://github.com/mattsta/signal-backup, which I suspect will be hard to get working now.

Example

An export for a group conversation looks as follows:

[2019-05-29, 15:04] Me: How is everyone?
[2019-05-29, 15:10] Aya: We're great!
[2019-05-29, 15:20] Jim: I'm not.

Images are attached inline with ![name](path) while other attachments (voice notes, videos, documents) are included as links like [name](path) so a click will take you to the file.

This is converted to HTML at the end so it can be opened with any web browser. The stylesheet .css is still very basic but I'll get to it sooner or later.

Installation

๐Ÿš€ Easy mode with Docker

This tool has some pretty difficult dependencies, so it's easier to get some help from Docker. For most people this will probably be the easiest way. It requires installing Docker and then pulling a 200MB image, so avoid this if data use is a concern.

First off, install Docker.

Then install this package:

pip install signal-export

Then run the script! It will do some Docker stuff under the hood to get your data out of the encrypted database.

sigexport ~/signal-chats
# output will be saved to the supplied directory

See Alternative installation methods below for other ways to get it working.

Usage

Please fully exit your Signal app before proceeding, otherwise you will likely encounter an I/O disk error, due to the message database being made read-only, as it was being accessed by the app.

See the full help info:

sigexport --help

Disable pagination on HTML, and overwrite anything at the destination:

sigexport --paginate=0 --overwrite ~/signal-chats

List available chats and exit:

sigexport --list-chats

Export only the selected chats:

sigexport --chats=Jim,Aya ~/signal-chats

You can add --source /path/to/source/dir/ if the script doesn't manage to find the Signal config location. Default locations per OS are below. The directory should contain a folder called sql with db.sqlite inside it.

  • Linux: ~/.config/Signal/
  • macOS: ~/Library/Application Support/Signal/
  • Windows: ~/AppData/Roaming/Signal/

You can also use --old /previously/exported/dir/ to merge the new export with a previous one. Nothing will be overwritten! It will put the combined results in whatever output directory you specified and leave your previos export untouched. Exercise is left to the reader to verify that all went well before deleting the previous one.

Alternative installation methods

๐Ÿฆ† Slightly harder: build your own Docker image

You can always build your own Docker image if you prefer that. Just clone this repository and build it.

git clone https://github.com/carderne/signal-export.git
cd signal-export
docker build -t sigexport .

Then you can run the script using your own Docker image:

sigexport --use-docker --docker-image=sigexport ~/signal-chats

๐ŸŒ‹ Hard mode: install the full dependencies

This involves actually installing the stuff into your system, but has proven hard to get work for many, especially on Windows.

Before you can install signal-export, you need to get sqlcipher working. Follow the instructions for your OS:

For Ubuntu (other distros can adapt to their package manager)

Install the required libraries.

sudo apt install libsqlite3-dev tclsh libssl-dev

Then clone sqlcipher and install it:

git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto -lsqlite3"
make && sudo make install

NOTE: If you instead install sqlcipher via your distro's package manager, make sure the version is sufficient. 4.0.1 is known to be too old, 4.5.0 is known to work. Old versions will spit out errors such as "malformed database schema (messages) - near "AS": syntax error". See issue 26.

For MacOS

  • Install Homebrew.
  • Run brew install openssl sqlcipher

For Windows

YMMV, but apparently Ubuntu 20.04 on WSL2 should work! That is, install WSL2 and Ubuntu 20.04 on Windows, and then follow the For Linux instructions and feel your way forward. But probably just give up here and use the Docker method instead.

Install signal-export

Then you're ready to install signal-export: (Note the [all] that has been added!)

pip install signal-export[all]

Then you should be able to use the Usage instructions as above.

Development

git clone https://github.com/carderne/signal-export.git
cd signal-export
pip install -e .[dev]
pre-commit install

Run tests with:

pytest --cov=sigexport --cov-report=term-missing tests/
tox

Similar things

signal-backup-decode might be easier if you use Android!

signal-export's People

Contributors

adam-sroka avatar ankostis avatar carderne avatar d235j avatar fjulian avatar haarp avatar jwgn avatar mattsta avatar rajkumaar23 avatar rmsds avatar strengthless avatar t4cc0re avatar wolfgirl42 avatar

Stargazers

 avatar

Watchers

 avatar

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.