Git Product home page Git Product logo

signal2html's Introduction

signal2html: Convert Signal backups to pretty HTML

build PyPI version Downloads

This is a Python script to convert a backup of Signal messages to pretty HTML:

Update March 2023: This package isn't much maintained at the moment, please use the export functionality of signalbackup-tools directly: https://github.com/bepaald/signalbackup-tools#export

Why?

My phone was getting full and I wanted to preserve my Signal messages in a nice way.

How?

  1. Install this package using pip:

    $ pip install signal2html
    
  2. Next, clone and compile signalbackup-tools as follows:

    $ git clone https://github.com/bepaald/signalbackup-tools
    $ cd signalbackup-tools
    $ bash BUILDSCRIPT.sh
    

    This should give you a signalbackup-tools executable script.

  3. Create an encrypted backup of your Signal messages in the app (Settings -> Chats and Media -> Create backup), and transfer this to your computer. Make sure to record the encryption password.

  4. Unpack your encrypted backup using signalbackup-tools as follows:

    $ mkdir signal-backup/
    $ signalbackup-tools signal-YYYY-MM-DD-HH-MM-SS.backup <PASS> --output signal_backup/
    

    where you replace signal-YYYY-MM-DD-HH-MM-SS.backup with the actual filename of your Signal backup and <PASS> with the 30-digit encryption password (without spaces).

  5. Now, run signal2html on the backup directory, as follows:

    $ signal2html -i signal_backup/ -o signal_html/
    

    This will create a HTML page for each of the message threads in the signal_html directory, which you can subsequently open in your browser. Update March 2023: This package isn't much maintained at the moment, please use the export functionality of signalbackup-tools directly: https://github.com/bepaald/signalbackup-tools#export

Notes

This is a hastily-written script that has only been tested on a few Signal database versions. I hope it works on other backup versions as well, but if you encounter any issues please submit a pull request.

See the LICENSE file for licensing details and copyright.

Please be aware that Signal messages are encrypted for a reason, and your contacts may use it specifically because it provides significant privacy. By exporting and decrypting your messages, you should take responsibility for maintaining this same level of privacy (for instance by only storing the plaintext messages on encypted volumes/drives).

Originally written by Gertjan van den Burg. See the contributors file for a full list of all contributors.

signal2html's People

Contributors

ericthegrey avatar gjjvdburg avatar otto-aa avatar ph0llux avatar tmo1 avatar webtroter 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  avatar  avatar

signal2html's Issues

Emoji Reactions (Currently Missing)

Discussed in #62

Originally posted by bit-less January 18, 2022
I'm absolutely impressed with the output from this project!! The only thing that it seems to be missing, that's really significant, is the emoji reactions, because they give context to the feeling and flow of the dialog, and are actually responses in and of themselves that don't need words. So to me, it's critical to add that feature. Can that be done?

Some attachments do not behave well in Firefox

Attachments do not always behave well in Firefox and do not open a 'file save' dialog.

  • PDF files (application/pdf) when handled internally
  • XML files

This is likely due to the extension being 'bin' for all files. The solution is expected to be to copy the attachment into the output using:

  • The provided file name if available (see filename column in part table) (taking care not to clobber, e.g. using part id as prefix).
  • A reasonable extension (e.g. image/jpeg -> jpg) otherwise.

Instructions for Noob

Hello, I lost someone in my life and I would like to back up some important chats from Signal, otherwise, they will be gone by switching from android to iOS. Luckily I saw there might be ways to retrieve chat records, but unfortunately, I know nothing, literally nothing, about coding/scripting so I couldn't understand any of the steps.

I did my best to follow the steps...

$ pip install signal2html
I tried to run it with cmd but there was an error message.
after my research, turn out I need to install pip/python first, I have no idea what it is but I fellow steps on the internet and I guess I have installed it, and maybe the signal2html package. Tried to run it again it shows something like " requirement already satisfied....", so I guess I have made 1 step.

$ git clone https://github.com/bepaald/signalbackup-tools
$ cd signalbackup-tools
$ bash BUILDSCRIPT.sh
ran 1st script I saw there is some installation. nothing happens for the second script. Another error message saying g++ is missing.
I have no idea what it is but I researched and installed g++ based on https://code.visualstudio.com/docs/cpp/config-mingw.
now I can run the third script and some messages pop out like " Building (1/98).." and run until "Building (98/98)..."
Not sure what are they but at least it is loading something, so I guess this step is ok?

$ mkdir signal-backup/
$ signalbackup-tools signal-YYYY-MM-DD-HH-MM-SS.backup --output signal_backup/
I ran the first step and nothing happened.
I ran the second step and it shows the system can not locate the files. I have exported the backup file and marked the code that Signal provided to me. And I have followed the instruction to change the 2nd script with the file title and pass. But I have no idea where to place that backup file, seems the script needs to know where is it. I have been stuck on this for days and lost hope.

I hope you would point out any issues for steps, and way forward, those chats mean so much to me.

If you read until here, thanks a lot for your time.

Add an option to filter output by date

Hi,
thank you very much for that handy tool!

I don't want to preserve all database content, but just certain conversations. Hence I would love some options to filter, especially by date. Additionally filtering by contact/group would be nice, too.

Issue on line 214 core.py

There is an issue with the parameter list passed on line 214 in core.py

Does the solution work on database version 90

AttributeError: 'NoneType' object has no attribute 'new_members'

Dear GJ,
Thank you so much for this tool. The first db went very well, but another from a different phone has this issue. The reading of db finished without errors, but signal2html ended after 2 minutes with this output:

Traceback (most recent call last):

File "/home/gajus/.local/bin/signal2html", line 8, in

sys.exit(main())

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/main.py", line 20, in main

sys.exit(main())

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/ui.py", line 35, in main

process*backup(args.input*dir, args.output_dir)

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/core.py", line 679, in process_backup

populate_thread(

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/core.py", line 636, in populate_thread

sms*records = get*sms_records(db, thread, addressbook)

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/core.py", line 101, in getsmsrecords

data = get*data*from*body(*type, body, addressbook, _id)

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/core.py", line 379, in getdatafrom_body

data = get*group*update*data*v2(

File "/home/gajus/.local/lib/python3.8/site-packages/signal2html/core.py", line 326, in getgroupupdatedatav2

for member in change.new_members:

AttributeError: 'NoneType' object has no attribute 'new_members'

Encrypted status messages

Status messages like "You created the group" or "You changed the avatar" appear in the thread but encrypted.

Encrypted

The best solution would be if it was possible to decrypt these messages. But I guess this will not be simple or may even be impossible.

The most simple solution might be to identify such messages and don't output them.

In my case these messages are always single strings without spaces. I only have similar strings for posted URLs. But these always start with http.

I came up with a very basic test if the message text might be such an encrypted message. I guess there might be better solutions.

def encrypted(text):
    return (
        text is not None
        and text
        and not text.startswith('http')
        and len(text.strip().split()[0]) > 30
    )

AttributeError: 'NoneType' object has no attribute 'name' - in get_group_update_data_v1

$ signal2html  -i signal_backup/ -o signal_backup_html/
2022-01-04 21:29:11 | INFO - This is signal2html version 0.2.8
2022-01-04 21:29:11 | INFO - Found Signal database version: 123.
2022-01-04 21:29:11 | WARNING - This database version is untested, please report errors.
2022-01-04 21:29:11 | WARNING - Couldn't find attachment '/home/markus/tmp/signal_backups/signal_backup/Attachment_355_1556041763007.bin'. Maybe it was deleted or never downloaded?

... some more warnings snipped

2022-01-04 21:29:52 | WARNING - Couldn't find attachment '/home/markus/tmp/signal_backups/signal_backup/Attachment_5198_1632986264422.bin'. Maybe it was deleted or never downloaded?
Traceback (most recent call last):
  File "/home/markus/.local/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/core.py", line 679, in process_backup
    populate_thread(
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/core.py", line 636, in populate_thread
    sms_records = get_sms_records(db, thread, addressbook)
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/core.py", line 101, in get_sms_records
    data = get_data_from_body(_type, body, addressbook, _id)
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/core.py", line 383, in get_data_from_body
    data = get_group_update_data_v1(
  File "/home/markus/.local/lib/python3.8/site-packages/signal2html/core.py", line 232, in get_group_update_data_v1
    name = addressbook.get_recipient_by_uuid(member.uuid).name
AttributeError: 'NoneType' object has no attribute 'name'

Database version 65

Hey,

I love your work, the dumped html looks very nice! It's the best "temporary" solution for people migrating Android-iOS where Signal doesn't yet provide a cross-backup solution, to look at their old messages.

Unfortunately I had to work with database version 65 instead of 23, which meant your scripts had a few errors.

I've made some very quick changes in a branch of my own, which means it now works with database version 65: https://github.com/jonaslb/signal2html

I took exactly zero care to make sure it was also still working with older versions though, so thats why I'm not sending you a PR. But please feel free to merge it anyway, if you like it, or to take parts of it if you want to do something differently.

Database version 166

Does anyone have any suggestions as to what I can change to get this working with database version 166? I tried using the updated files from @CSnowRules' fork (found in issue #72), but no luck.

2022-12-13 16:08:55 | INFO - This is signal2html version 0.2.11
2022-12-13 16:08:55 | INFO - Found Signal database version: 166.
2022-12-13 16:08:55 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
  File "/Users/foo/Library/Python/3.8/bin/signal2html", line 11, in <module>
    load_entry_point('signal2html==0.2.11', 'console_scripts', 'signal2html')()
  File "/Users/foo/Library/Python/3.8/lib/python/site-packages/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/Users/foo/Library/Python/3.8/lib/python/site-packages/signal2html/ui.py", line 37, in main
    process_backup(args.input_dir, args.output_dir)
  File "/Users/foo/Library/Python/3.8/lib/python/site-packages/signal2html/core.py", line 677, in process_backup
    qry = db.execute("SELECT COUNT(*) FROM sqlite_schema")
sqlite3.OperationalError: no such table: sqlite_schema

I can't even find a sqlite_schema table in my dumped data - that sounds like something they wouldn't have trivially removed in a new database format. Could my database export be incomplete?

Would appreciate suggestions on what could be wrong here.

Error with database version 118

Hello and thank you for your job πŸ™‚
I already ran signal2html with success but this time it's not working πŸ˜•
I've got this :

$ signal2html -i signal-backup-2021-11-15-14-02-50 -o signal-backup-2021-11-15-14-02-50_html
Found untested Signal database version: 118.
Group for recipient 1267 is '__textsecure_group__!2bdafcb85cd87e830306786cd49e0e9d' which does not exist.
Group for recipient 1268 is '__textsecure_group__!686d5b59b8720222ccb7864d99145ec3' which does not exist.
Group for recipient 1269 is '__textsecure_group__!8b6b00a62bfef9ff5e300a3eb348533a' which does not exist.
Group for recipient 1270 is '__textsecure_group__!bb2abe181e3f8e72efbbe96743c9585f' which does not exist.
Group for recipient 1271 is '__textsecure_group__!bc7acbecf4c8130a125a311bef4e292c' which does not exist.
Group for recipient 1294 is '__textsecure_group__!b7f2a230bd2f997b918066b89ae22ca0' which does not exist.
Traceback (most recent call last):
  File "/home/martin/.local/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/home/martin/.local/lib/python3.9/site-packages/signal2html/__main__.py", line 15, in main
    sys.exit(realmain())
  File "/home/martin/.local/lib/python3.9/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/martin/.local/lib/python3.9/site-packages/signal2html/core.py", line 257, in process_backup
    query = db.execute("SELECT _id, recipient_ids FROM thread")
sqlite3.OperationalError: no such column: recipient_ids

Unfortunately I can't help more, I don't understand anythings about Python πŸ˜“ 🐍
But I am ok to contribute with beers 🍻 (or something else)

Thanks for your help πŸ™‚

Error - Signal database 157

Hello GjjvdBurg, first of all, congratulations for your efforts at this project. ItΒ΄s very usefull.

IΒ΄m facing some issues in Signal database 157. I really appreciate if you can analyse the results bellow.

Captura de tela 2022-12-08 183510

Database version 40 - no such column: profile_joined_name

Hi,
I've got a problem to convert an old Signal database version.

Traceback (most recent call last):
  File "/home/pierre/.local/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/__main__.py", line 15, in main
    sys.exit(realmain())
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/core.py", line 653, in process_backup
    addressbook = make_addressbook(db, versioninfo)
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/addressbook.py", line 296, in make_addressbook
    return AddressbookV2(db)
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/addressbook.py", line 35, in __init__
    self._load_recipients()  # Must be implemented by subclass
  File "/home/pierre/.local/lib/python3.8/site-packages/signal2html/addressbook.py", line 247, in _load_recipients
    qry = self.db.execute(
sqlite3.OperationalError: no such column: profile_joined_name```

Thanks, 

BUILDSCRIPT.sh fails in Ubuntu 18.04 & 20.04.3

For Ubuntu 20.04.3 I get this error:

image

For Ubuntu 18.04, this is the error I had when running that script and following the install instructions on this site:

Inked1_LI

Based on the message, I replaced all instances of the -std=c++2a to -std=c++03 and ran it with the following errors:

Inked2_LI

I don't know what else to try, but I'm stoked about this project!

Relative URLs to attachments

First: thank you very much for creating this project! It's a very nice solution to preserve messages.

I was surprised about the absolute paths to attachments in the generated html. I moved the generated documents, which broke all references. All attachments get copied to a certain place. So, it would be easy to switch to relative urls. It seems like the logic is perfectly localized in get_attachment_filename(…). Just returning "attachments/"+fname should do the job.

BTW: You’re creating paths using OS-dependent delimiters. I guess, in HTML it is preferable to use forward-slashes.

Links in messages are not clickable

Hi, is it intentional that hyperlinks in the messages are not clickable? If not, that could be implemented like this:

Insert these lines into html.py:

import re
...
def format_message(body, mentions={}):
    ...
    for u in re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', new_body):
        new_body = new_body.replace(u, '<a href="%s" target="_blank">%s</a>' % (u, u), 1)
    return new_body

And make the links yellow for improved readability, by inserting into thread.html:

      .msg pre a {
        color: yellow;
      }

DB v146 KeyError: 'location'

Hello,

I got the following error when testing signal2html on a fresh backup.

2022-07-17 12:54:50 | INFO - This is signal2html version 0.2.9
2022-07-17 12:54:50 | INFO - Found Signal database version: 146.
2022-07-17 12:54:50 | WARNING - This database version is untested, please report errors.
2022-07-17 12:54:50 | INFO - Group for recipient 616 is '__signal_mms_group__!0a91b7e96a7748b4e8b44ee8e75d0dba' and will be called by group id using name 'Group 2'.
2022-07-17 12:54:50 | INFO - Group for recipient 617 is '__signal_mms_group__!9d36a9e95af23aa812f2e1cb1088f9d1' and will be called by group id using name 'Group 1'.
Traceback (most recent call last):
  File "/usr/local/bin/signal2html", line 33, in <module>
    sys.exit(load_entry_point('signal2html', 'console_scripts', 'signal2html')())
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/core.py", line 693, in process_backup
    dump_thread(t, output_dir)
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/html.py", line 271, in dump_thread
    body = format_message(body, thread.mentions.get(msg._id))
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/html.py", line 59, in format_message
    emoji_lookup = {p["location"]: p["emoji"] for p in emoji_pos}
  File "/home/phil/devel/00orig/signal/signal2html/signal2html/html.py", line 59, in <dictcomp>
    emoji_lookup = {p["location"]: p["emoji"] for p in emoji_pos}
KeyError: 'location'

I tested with regular pip install, then with pip install -e from a git clone.

Note that to get the code working at first, I had to fix this typo:

diff --git a/signal2html/html.py b/signal2html/html.py
index 53cf0a2..7a7098c 100644
--- a/signal2html/html.py
+++ b/signal2html/html.py
@@ -11,7 +11,7 @@ import logging
 
 from types import SimpleNamespace as ns
 
-from emoji import emoji_lis as emoji_list
+from emoji import emoji_list as emoji_list
 from jinja2 import Environment

UnicodeEncodeError: 'charmap' codec can't encode characters in position 110-115: character maps to <undefined>

Hello, I'm getting this error.

PS C:\Users\win>  signal2html -i C:\Users\win\Desktop\Backups\Signal\RAWBAK -o C:\Users\win\Desktop\Backups\Signal\signal_html
c:\users\win\appdata\local\programs\python\python38-32\lib\site-packages\signal2html\core.py:42: UserWarning: Warning: Found untested Signal database version: 20.
  warnings.warn(
Traceback (most recent call last):
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\win\AppData\Local\Programs\Python\Python38-32\Scripts\signal2html.exe\__main__.py", line 7, in <module>
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\site-packages\signal2html\__main__.py", line 8, in main
    sys.exit(realmain())
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\site-packages\signal2html\ui.py", line 33, in main
    process_backup(args.input_dir, args.output_dir)
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\site-packages\signal2html\core.py", line 213, in process_backup
    dump_thread(t, output_dir)
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\site-packages\signal2html\html.py", line 186, in dump_thread
    fp.write(html)
  File "c:\users\win\appdata\local\programs\python\python38-32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 110-115: character maps to <undefined>

Running on Windows 10. Thank you for taking the time here, looks quite nice.

Troubleshooting signal2html execution

Having trouble processing the signal_backup to signal_html. I apologize if this is user error but I figured it might be a bug? Any help is appreciated. I have my signal_backup/ and signal_html/ directories within my Python39/ directory. Executing the signalbackup-tools_win.exe and creating a decrypted backup seemed to have went perfect, beforehand.

PS C:\Users\Chris\AppData\Local\Programs\Python\Python39>
PS C:\Users\Chris\AppData\Local\Programs\Python\Python39> ./python.exe -m signal2html -i signal_backup/ -o signal_html/
INFO:signal2html.versioninfo:Using database version 105.
WARNING:signal2html.core:Found untested Signal database version: 105.
WARNING:signal2html.addressbook:Recipient with rid 2 not in addressbook, adding it.
Traceback (most recent call last):
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\site-packages\signal2html\__main__.py", line 20, in <module>
    main()
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\site-packages\signal2html\__main__.py", line 15, in main
    sys.exit(realmain())
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\site-packages\signal2html\ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\site-packages\signal2html\core.py", line 348, in process_backup
    recipient = addressbook.get_recipient_by_address(recipient_id)
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\site-packages\signal2html\addressbook.py", line 232, in get_recipient_by_address
    return self._add_recipient(rid, "", get_random_color(), False, "")
TypeError: _add_recipient() missing 1 required positional argument: 'phone'
PS C:\Users\Chris\AppData\Local\Programs\Python\Python39>

AttributeError: 'NoneType' object has no attribute 'by'

2021-12-16 15:14:06 | INFO - This is signal2html version 0.2.7
2021-12-16 15:14:06 | INFO - Using database version 120.
2021-12-16 15:14:06 | WARNING - Found untested Signal database version: 120.

I think the error:
AttributeError: 'NoneType' object has no attribute 'by'

Might be caused by group chats perhaps?

Database Version 140 - no such column: reactions

Hi,
I have this issue with the latest version of Signal on Android.
I am running the signalbackup-tools executable on Windows 10.

2022-05-11 21:49:12 | INFO - This is signal2html version 0.2.9
2022-05-11 21:49:12 | INFO - Found Signal database version: 140.
2022-05-11 21:49:12 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
  File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\lib\site-packages\signal2html\__main__.py", line 24, in <module>
    main()
  File "C:\Python39\lib\site-packages\signal2html\__main__.py", line 20, in main
    sys.exit(main())
  File "C:\Python39\lib\site-packages\signal2html\ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "C:\Python39\lib\site-packages\signal2html\core.py", line 690, in process_backup
    populate_thread(
  File "C:\Python39\lib\site-packages\signal2html\core.py", line 648, in populate_thread
    mms_records = get_mms_records(
  File "C:\Python39\lib\site-packages\signal2html\core.py", line 482, in get_mms_records
    qry = db.execute(
sqlite3.OperationalError: no such column: reactions

Thanks for your work

Missing Conversations in html export folder

I am experiencing missing conversations from the backup, getting multiple of the the following errors when running signal2html:

Couldn't find attachment '/signal-backup/Attachment_978_1552816065840.bin'. Maybe it was deleted or never downloaded.

Followed by the following trace back:

Traceback (most recent call last):
  File "/usr/local/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/signal2html/__main__.py", line 15, in main
    sys.exit(realmain())
  File "/usr/local/lib/python3.9/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "/usr/local/lib/python3.9/site-packages/signal2html/core.py", line 672, in process_backup
    dump_thread(t, output_dir)
  File "/usr/local/lib/python3.9/site-packages/signal2html/html.py", line 268, in dump_thread
    body = format_message(body, thread.mentions.get(msg._id))
  File "/usr/local/lib/python3.9/site-packages/signal2html/html.py", line 72, in format_message
    mention = mentions.get(i)
AttributeError: 'NoneType' object has no attribute 'get'

Could this be an issue from the signalbackup-tools executable? The mentioned files seem not to have been extracted to the signal_backup folder. Has Anybody else experienced similar issues? If so I will open the issue in there (my first-ever issue in github!).

--> This is such a great project for archiving chats, thanks for the awesome work!!!! :)

Issue with Signal database version: 176

Got the same/another problem. Somebody an idea how to solve this?


stefan@stefan-virtual-machine:~/signalbackup-tools$ signal2html -i signal_backup/ -o signal_html/
2023-02-15 09:58:13 | INFO - This is signal2html version 0.2.11
2023-02-15 09:58:13 | INFO - Found Signal database version: 176.
2023-02-15 09:58:13 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
  File "/home/stefan/.local/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/home/stefan/.local/lib/python3.10/site-packages/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/home/stefan/.local/lib/python3.10/site-packages/signal2html/ui.py", line 37, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/stefan/.local/lib/python3.10/site-packages/signal2html/core.py", line 688, in process_backup
    query = db.execute(f"SELECT _id, {recipient_id_expr} FROM thread")
sqlite3.OperationalError: no such column: thread_recipient_id

Signal database version 219: no such table sqlite_schema

Getting the below error trying to convert v219 database, but I fear this project is dead. No commits for over a year now...

2024-03-22 20:49:45 | INFO - This is signal2html version 0.2.11
2024-03-22 20:49:45 | INFO - Found Signal database version: 219.
2024-03-22 20:49:45 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
  File "/Users/<userid>/Library/Python/3.8/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/Users/<userid>/Library/Python/3.8/lib/python/site-packages/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/Users/<userid>/Library/Python/3.8/lib/python/site-packages/signal2html/ui.py", line 37, in main
    process_backup(args.input_dir, args.output_dir)
  File "/Users/<userid>/Library/Python/3.8/lib/python/site-packages/signal2html/core.py", line 677, in process_backup
    qry = db.execute("SELECT COUNT(*) FROM sqlite_schema")
sqlite3.OperationalError: no such table: sqlite_schema

ModuleNotFoundError: No module named 'dataclasses'

Traceback (most recent call last):
File "d:\program files\python\python36\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "d:\program files\python\python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\Program Files\Python\Python36\Scripts\signal2html.exe_main
.py", line 4, in
File "d:\program files\python\python36\lib\site-packages\signal2html_init
.py", line 3, in
from .core import process_backup
File "d:\program files\python\python36\lib\site-packages\signal2html\core.py", line 18, in
from .models import (
File "d:\program files\python\python36\lib\site-packages\signal2html\models.py", line 15, in
from dataclasses import dataclass, field
ModuleNotFoundError: No module named 'dataclasses'

Any help?

Error with database 119

Hello,
I'm trying to use signal2html version 0.2.9 and i have a bad issue.

2022-04-20 11_49_20-C__Windows_System32_cmd exe

Have you worked on this version ?

Thanks for a solution ;)

Signal database version: 167

I assume this is just an DB update?

2022-12-23 21:06:00 | INFO - This is signal2html version 0.2.11
2022-12-23 21:06:00 | INFO - Found Signal database version: 167.
2022-12-23 21:06:00 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
  File "/home/s/projects/signal/venv/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "/home/s/projects/signal/venv/lib/python3.10/site-packages/signal2html/__main__.py", line 20, in main
    sys.exit(main())
  File "/home/s/projects/signal/venv/lib/python3.10/site-packages/signal2html/ui.py", line 37, in main
    process_backup(args.input_dir, args.output_dir)
  File "/home/s/projects/signal/venv/lib/python3.10/site-packages/signal2html/core.py", line 688, in process_backup
    query = db.execute(f"SELECT _id, {recipient_id_expr} FROM thread")
sqlite3.OperationalError: no such column: thread_recipient_id

N/A

Apologies, I've just realised this should have been at signalbackup-tools, not here. Closing.

Print contact name and phone number

Thank you for this really useful tool !

It would be perfect if the contact name and phone number are displayed at the top of the conversation and also as the folder name.

Thanks.

Database version 163

Hello,
When trying this program, I get this error message:

image

Does someone know how to extract my signal backup?

Thanks!

recipient_id is int in db verison 85

The model for RecipientId expects RecipientId._id to be a string, however an integer value is used. I've only tested it with db version 85, I don't know if this is due to a change in the database schema.

Here is the current thread table which contains the recipient_ids column used:

sqlite> PRAGMA table_info(thread);
0|_id|INTEGER|0||1
1|date|INTEGER|0|0|0
2|message_count|INTEGER|0|0|0
3|recipient_ids|INTEGER|0||0
4|snippet|TEXT|0||0
5|snippet_cs|INTEGER|0|0|0
6|read|INTEGER|0|1|0
7|type|INTEGER|0|0|0
8|error|INTEGER|0|0|0
9|snippet_type|INTEGER|0|0|0
10|snippet_uri|TEXT|0|NULL|0
11|snippet_content_type|TEXT|0|NULL|0
12|snippet_extras|TEXT|0|NULL|0
13|archived|INTEGER|0|0|0
14|status|INTEGER|0|0|0
15|delivery_receipt_count|INTEGER|0|0|0
16|expires_in|INTEGER|0|0|0
17|last_seen|INTEGER|0|0|0
18|has_sent|INTEGER|0|0|0
19|read_receipt_count|INTEGER|0|0|0
20|unread_count|INTEGER|0|0|0
21|last_scrolled|INTEGER|0|0|0
22|pinned|INTEGER|0|0|0

Because of this I had to comment out this line to make it work for groups:

if ar.recipientId._id.startswith("__textsecure_group__"):

error parsing command line unknown option

WhatsApp Image 2022-04-24 at 5 07 04 PM

I have been using latest version of signal2html tool with ubuntu but whenever I try to extract my backup files , I get an error called " error parsing command line option". I never came across this type of error before also I have tried to extract my other backup files too but every time the same error is displayed , If anyone knows about this issue then please give a solution about it ASAP! .

Split large conversations into multiple files

Suggested by @ma-phi via email. For long conversations it might be nice to optionally separate conversations into multiple HTML files such that they load faster when viewed in the browser. If we do this it would be helpful to show the start date in the filename.

A simple way to do this would be to add a --max-msg or --thread-length flag to the UI and split the messages into chunks just before we write to HTML.

Database version 110: thread table has no recipient_ids column

Hello, I've just found signal2html, as it is exactly what I was looking for. Unfortunately, it does not work (Signal version 5.17.3 running on Android 11):

Found untested Signal database version: 110.
Traceback (most recent call last):
  File "signal2html/bin/signal2html", line 8, in <module>
    sys.exit(main())
  File "signal2html/lib/python3.8/site-packages/signal2html/__main__.py", line 15, in main
    sys.exit(realmain())
  File "signal2html/lib/python3.8/site-packages/signal2html/ui.py", line 35, in main
    process_backup(args.input_dir, args.output_dir)
  File "signal2html/lib/python3.8/site-packages/signal2html/core.py", line 590, in process_backup
    query = db.execute("SELECT _id, recipient_ids FROM thread")
sqlite3.OperationalError: no such column: recipient_ids

The thread table looks like that:

sqlite> PRAGMA table_info(thread);
0|_id|INTEGER|0||1
1|date|INTEGER|0|0|0
2|thread_recipient_id|INTEGER|0||0
3|message_count|INTEGER|0|0|0
4|snippet|TEXT|0||0
5|snippet_charset|INTEGER|0|0|0
6|snippet_type|INTEGER|0|0|0
7|snippet_uri|TEXT|0|NULL|0
8|snippet_content_type|INTEGER|0|NULL|0
9|snippet_extras|TEXT|0|NULL|0
10|read|INTEGER|0|1|0
11|type|INTEGER|0|0|0
12|error|INTEGER|0|0|0
13|archived|INTEGER|0|0|0
14|status|INTEGER|0|0|0
15|expires_in|INTEGER|0|0|0
16|last_seen|INTEGER|0|0|0
17|has_sent|INTEGER|0|0|0
18|delivery_receipt_count|INTEGER|0|0|0
19|read_receipt_count|INTEGER|0|0|0
20|unread_count|INTEGER|0|0|0
21|last_scrolled|INTEGER|0|0|0
22|pinned|INTEGER|0|0|0

AttributeError: 'NoneType' object has no attribute 'new_members'

Many thanks for 0.2.8 correcting the attribute 'by'. Unfortunately, there are other issues.
This tile, I get

signal2html -i db -o out
2021-12-20 13:02:25 | INFO - This is signal2html version 0.2.8
2021-12-20 13:02:25 | INFO - Found Signal database version: 120.
2021-12-20 13:02:25 | WARNING - This database version is untested, please report errors.
Traceback (most recent call last):
File "/usr/local/bin/signal2html", line 33, in
sys.exit(load_entry_point('signal2html==0.2.8', 'console_scripts', 'signal2html')())
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/main.py", line 20, in main
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/ui.py", line 35, in main
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/core.py", line 679, in process_backup
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/core.py", line 636, in populate_thread
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/core.py", line 101, in get_sms_records
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/core.py", line 379, in get_data_from_body
File "/usr/local/lib/python3.9/dist-packages/signal2html-0.2.8-py3.9.egg/signal2html/core.py", line 326, in get_group_update_data_v2
AttributeError: 'NoneType' object has no attribute 'new_members'

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.