glemco
5ed260b0b7
Add support for telegram JSON file format
...
Add the --telegram command line argument that, combined with a JSON
output, generates a Telegram compatible JSON file [1].
The JSON is per-chat, so the --telegram argument implies the
--json-per-chat setting.
I took a few shortcuts:
* Contact and Ids are inferred from the chat id or phone numbers
* All text is marked as plain (e.g. no markup or different types)
* Only personal chats and private groups supported
* Private groups are defined if the chat has a name
* Various ids try to match the ones in WA but may require bulk edits
[1] - https://core.telegram.org/import-export
Fixes: https://github.com/KnugiHK/WhatsApp-Chat-Exporter/issues/152
2025-06-16 13:01:33 +02:00
KnugiHK
99213503c4
Fix on incorrect rejection by the regex of the size_str
...
String like '1. MB' should be accepted
2025-06-01 12:17:21 +08:00
KnugiHK
f89f53cf2d
Fix test cases
2025-06-01 12:15:54 +08:00
KnugiHK
0ecfe6c59a
Cast numeric string in readable_to_bytes
2025-06-01 12:15:15 +08:00
KnugiHK
706466f63b
Enforce a tighter check on the input of size_str
2025-06-01 11:54:24 +08:00
KnugiHK
24653b8753
Fixed integer input for --size not being casted to int #156
2025-06-01 11:53:45 +08:00
KnugiHK
e408c31415
Fix: it is impossible to have 0.1 byte as byte is the smallest unit
2025-05-17 19:26:18 +08:00
KnugiHK
6a0fca3e9d
Add more tests for utility
2025-05-17 19:16:57 +08:00
KnugiHK
bbb558713f
Replace sanitize_filename with safe_name
2025-05-17 18:24:30 +08:00
KnugiHK
ea6e72bf0b
Bug fix on incorrectly striping decimal to integer
2025-05-17 17:46:51 +08:00
KnugiHK
d7ded16239
Reimplement the convert_time_unit function to make it more human-readable
2025-05-17 17:35:30 +08:00
KnugiHK
8c2868a60e
Fix on missing return in get_status_location
2025-05-17 16:20:11 +08:00
KnugiHK
a53e5a2b3d
Update type hint syntax for Python < 3.10 compatibility
2025-05-17 16:18:16 +08:00
KnugiHK
3f88f7fe08
Replacing slugify with a new function
2025-05-17 16:04:31 +08:00
KnugiHK
96e483a6b0
Clean up unused code in bplist.py
2025-05-11 18:16:17 +08:00
KnugiHK
587b743522
Fix logging for decrypting whatsapp database
2025-05-11 18:14:41 +08:00
KnugiHK
33149075d3
autopep8
2025-05-11 18:07:51 +08:00
KnugiHK
cc410b8503
Save the environment by reducing CI targets
2025-05-11 18:01:25 +08:00
KnugiHK
e8acf6da32
Fix key access in f-string for older Python
2025-05-11 17:59:20 +08:00
KnugiHK
667c005a67
Make received_ & read_timestamp optional
2025-05-11 17:49:51 +08:00
KnugiHK
bb48cd381b
Fix test case where media_base should never be None
2025-05-11 17:49:33 +08:00
KnugiHK
ae6e8ba7e2
Make to_ & from_json functions dynamic
...
This is to prevent error like #150 in the future
2025-05-11 17:46:00 +08:00
KnugiHK
1eea5fc5c1
Use the new chat importing method from data_model
...
This commit also fixes #150
2025-05-11 17:29:24 +08:00
KnugiHK
dd795f3282
Adjust banner position
2025-05-11 17:27:23 +08:00
KnugiHK
75c3999567
Update debug log name
2025-05-11 16:56:19 +08:00
KnugiHK
fa41572753
Change print to logger for better logging in the future
...
This commit also added --debug and --no-banner options, which will enable debug level of logging and supress the default banner
2025-05-11 16:53:46 +08:00
KnugiHK
0681661660
Update bruteforce_crypt15.py
2025-05-08 00:51:09 +08:00
KnugiHK
907fe4aa91
Update ci.yml
2025-05-07 22:56:52 +08:00
KnugiHK
80cb868beb
Expend all tests to all common systems
2025-05-07 22:49:06 +08:00
KnugiHK
904f44dc12
Update test_nuitka_binary.py
2025-05-07 22:40:28 +08:00
KnugiHK
520f31651c
Forgot to install nuitka
2025-05-07 22:31:11 +08:00
KnugiHK
c346199d05
Fix python versions in ci.yml
2025-05-07 22:30:04 +08:00
KnugiHK
3e37bbb021
Create test_nuitka_binary.py
2025-05-07 22:28:48 +08:00
KnugiHK
0bb4f52a26
Add CI
2025-05-07 21:46:19 +08:00
KnugiHK
a3294ead11
Add a basic sanity check for the exporter
...
The check make sure all modules can be imported and the exporter can at least run without any arguments provided.
2025-05-07 21:45:45 +08:00
KnugiHK
e2b773eac5
Move all tests to single directory
2025-05-07 21:31:29 +08:00
KnugiHK
170a108109
Bug fix on incorrectly normalized number that starts with 0
2025-05-07 21:31:03 +08:00
Knugi
1348ec89f0
Merge pull request #149 from fschuh/main_test
...
Support for incremental merges of two export folders
2025-05-07 21:18:33 +08:00
fschuh
db42ad123d
Fixed unit tests so they no longer fail on Windows
2025-05-05 15:53:13 -04:00
fschuh
dad7666adb
Updated to also use shutil for JSON file copying
2025-05-05 12:32:29 -04:00
KnugiHK
a58dd78be8
PEP8
2025-05-05 17:13:43 +08:00
KnugiHK
3220ed2d3f
Update testing data
2025-05-05 17:11:55 +08:00
KnugiHK
4e1d994aa5
Add message_type when importing json
2025-05-05 17:10:57 +08:00
KnugiHK
4ca56b1c5c
Bug fix on wrong type of self.message_type
2025-05-05 17:08:35 +08:00
KnugiHK
60790d89e3
Remove args.incremental_merge from device type check
2025-05-05 16:15:51 +08:00
KnugiHK
ed2ec7cb9e
Exit if no json is found
2025-05-05 16:14:05 +08:00
KnugiHK
75c2db6d5c
Accept both raw timestamp and formatted time string
2025-05-05 16:13:48 +08:00
KnugiHK
352be849a7
Bug fix on messages with timestamp being '0'
2025-05-05 16:13:17 +08:00
KnugiHK
3e3aeae7ad
key_id can also be a string
2025-05-05 16:12:57 +08:00
KnugiHK
9d76cf60af
Attach media_base from JSON
2025-05-05 16:12:13 +08:00