idealchain / signal-media-exporter Goto Github PK
View Code? Open in Web Editor NEWA script to export media files from Signal Desktop.
License: GNU General Public License v3.0
A script to export media files from Signal Desktop.
License: GNU General Public License v3.0
Hi,
signal-media-exporter fails with Version 6.30.1 of signa-desktop:
$ python -m signal_media_exporter
2023-09-10 11:15:39 CRITICAL DatabaseError "malformed database schema (messages_on_insert_insert_mentions) - near ">>": syntax error" - please check the database and the sqlcipher parameters!
Exporting... |████████████████████████████████████████| 0 in 0.1s (0.00/s)
2023-09-10 11:15:40 ERROR No media messages found.
$ apt show signal-desktop
Package: signal-desktop
Version: 6.30.1
[...]
Perhaps there is a relation with this bugreport.
Signal has implemented a story feature some time ago. Exporting the pictures and videos of a story only "half-works": some are exported, some are not.
The reason is that within the database, Signal Desktop represents every single attachment that belongs to a story as a separate message. Now, if there is a story published with multiple media files, all these messages have the sent-timestamp within the same second, get assigned the same filename and all but the first file are skipped for export. I guess the problem is the assumption that not more than one media message is sent from a contact per second.
There are some options, but they have to be considered carefully:
Are voice notes not considered media in signal? I see that these audio clips are not included under "media" in the signal app, nor are they exported by this project. I would love to be able to export all audio clips from a chat.
Since v7.18.0, a new storage system is in place. It keeps the attachments encrypted on disk, which are then copied 1:1 by the script and quite useless.
If feasible, the script needs to be updated to decrypt on export.
Is it possible to group files not just by sender, but also or alternatively by the group in which they were sent?
From 7.16.0 on, Signal Desktop implemented the electron safeStorage API (commit: signalapp/Signal-Desktop@e87eaff, issue: signalapp/Signal-Desktop#6944) to encrypt the local DB encryption key in ~/.config/Signal/config.json. If a keyring is available and unlocked on startup, the unencrypted legacy key is replaced with an encrypted one.
If possible, the script could be extended to access the keyring. Meanwhile, as long as the key is not yet migrated, the keyring system can be kept disabled or Signal desktop can be started with the --pasword-store=basic
argument.
It would be great to not only export media, but also have an option to remove the media from signal in order to decrease the attachment file.
Whenever I try to run the exporter, both through standard pip and pipenv, I get the same issue:
2019-09-22 15:03:06 ██████ __main__[72005] INFO Read sqlcipher key: 0x████████████████████████████████████████████████████████████████
2019-09-22 15:03:06 ██████ __main__[72005] INFO Connected to sql/db.sqlite, reading messages...
Traceback (most recent call last):
File "export.py", line 193, in <module>
msgs = get_messages(config, key)
File "export.py", line 49, in get_messages
""")
pysqlcipher3.dbapi2.DatabaseError: file is not a database
(Note I have redacted some potentially personal information an replaced it with
█
blocks).
I am assuming I need to correct the path to the database, but where do I do that?
Thanks!
Hello and thanks for the great work
There is new feature which allows signal users to hide their phone number. They can give a pseudonym instead.
That made the media exporter crashing for me.
Also for some reason, one single contact of mine gives None value as "sender", but his number appears in "source" field of the msg.
So I added below patch in main.py line 113 :
if sender is None:
if 'source' in msg:
sender=msg['source']
else:
sender = 'Unknown sender'
and that fixed both issues for me.
It would be neater to get the actual pseudonym from the DB, instead of "unknown sender", but that's sufficient for my use.
regards
Sorry, the issue was linked to other chat export (not this one)
I am using signal on windows 10 x64. Installed all dependencies correctly and when I run the script following error comes up. Also when I try to open sql/db.sqlite in sqlite browser same error comes up. Probably, the database is encrypted with some extra level of security in latest desktop app version and that is why it is not being supported.
Traceback (most recent call last): File "../scab.py", line 41, in <module> c.execute("SELECT json, id, name, profileName, type, members FROM conversations") pysqlcipher3.dbapi2.DatabaseError: file is not a database
Hi. I think I would be very useful if the script was able to export the text contents of conversations in a readable format in addition to the media. It could be HTML or the "SMS Backup & Restore" XML format like signal-back was supposed to do.
Would you be interested in developing this? How difficult to you think it would be? It looks to me like you did the tricky work of opening the database and it would just be a matter of exporting the available data in the desired format. If that is the case, I might be interested in contributing it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.