Closed timatinsipid closed 1 year ago
Ah yep that line is commented out - the feature wasn't added (yet).
Check out the print_num_*
functions at the top of the file - they use the type
field to delineate between Signal messages and SMS/MMS messages. One could then use those type IDs around these lines:
to only pick out SMS/MMS messages.
So I changed line 265 to this cursor.execute('select from sms where type in (20, 87, 23) order by date_sent') and 280 to this cursor.execute('select from mms where msg_box in (20, 87, 23) order by date')
and it produced something, but i seem to have a lot of errors 2022-10-18 02:49:09 - INFO - Finished media export. Messages exported: 1516 Errors: 1220 A lot of them say ERROR - Could not find contact in the recipient table with ID: 113,
not sure if that is normal or not
It will have printed out the ... 1220 messages (that is a ton), if you scroll up and look through them, do they look like they maybe belong to a contact that you no longer have in your contacts list?
One approach might be to put a bit of stuff in the code like:
myoldcontacts = {
113: {"phone": "0400000000", "name": "John Smith"},
209: {"phone": "0400000000", "name": "Jane Smith"}
(and so on)
}
and then add a thing in the code around line
87 try:
88 phone = ADDRESSES[row["address"]]['phone']
89 name = ADDRESSES[row["address"]]['name']
90 except KeyError:
91 try:
92 phone = GROUPS[row["address"]][0]['phone']
93 name = GROUPS[row["address"]][0]['name']
94 except (KeyError, IndexError):
95 try:
96 phone = myoldcontacts[row["address"]]['phone'] <---- new stuff
97 name = myoldcontacts[row["address"]]['name'] <----- new stuff
98 except:
99 logging.error(f'Could not find contact in the recipient table with ID: {row["address"]}, sms looks like: {row}')
It all seems to be the same contact and they are a current contact. I made the changes with just contact 113 I added this around line 194 myoldcontacts = { 113: {"phone": "+12345678901", "name": "User Name"} } and added this to both the SMS and MMS sections around line 94 and line 134 except (KeyError, IndexError): try: phone = myoldcontacts[row["address"]]['phone'] name = myoldcontacts[row["address"]]['name'] except: logging.error(f'Could not find contact in the recipient table with ID: {row["address"]}, mms looks like: {row}')
This fixed the export issue and all the errors resolved so it looks like it was one bad contact that keeps using signal and stopping again
I would only want to export SMS/MMS
this was my preference as well. i was also able to sort myself out using the instructions above too. 🙏
I see in the script this
parser.add_argument('--mode', '-m', dest='mode', action='store', help="mode should be one sms-only, sms-mms-only, sms-mms-signal")
I would only want to export SMS/MMS but cannot see how to do it?