453 Commits

Author SHA1 Message Date
Knugi
42e583ac7c Merge pull request #175 from tomballgithub/vcard_fix
Fix vcard decoding errors
2025-12-15 23:00:07 +08:00
KnugiHK
71ca293557 Add main entry point
Added a main entry point in __main__.py to allow running the exporter as a script. Required for standalone binary
2025-12-15 01:12:04 +08:00
KnugiHK
5a80fe189d Add error handling to quoted-printable decoding
Wrapped the decode_quoted_printable function in a try-except block to handle decoding errors gracefully. If decoding fails, a warning is logged and the original value is returned, improving robustness when processing malformed vCard data.
2025-12-14 23:49:10 +08:00
KnugiHK
bb10203b44 Remove vobject dependency from project and workflow
Eliminated the use of the vobject library from the codebase, dependency groups, and GitHub Actions workflow. vobject is no longer a dependency for vCards enrichment.
2025-12-14 23:47:24 +08:00
KnugiHK
ddd0ac3143 Refactor vCard parsing to improve decoding and structure
Replaces regex-based vCard parsing with dedicated functions for parsing lines, handling quoted-printable encoding, and extracting fields. Adds support for CHARSET and ENCODING parameters, improves handling of multi-line and encoded values, and centralizes vCard entry processing for better maintainability and accuracy.
2025-12-14 23:00:48 +08:00
KnugiHK
43658a92c4 Replace print with logger in read_vcards_file
Changed the contact import message from a print statement to a logger.info call for better logging consistency.
2025-12-14 21:57:17 +08:00
KnugiHK
194ed29a6e Switch the default template to the WhatsApp-alike them
The old telegram theme can still be applied with the `--old-theme` option
2025-12-14 21:40:17 +08:00
tomballgithub
8c9c69a536 Print the number of imported vcards 2025-11-29 20:28:51 -06:00
tomballgithub
029700359e Fix vcard decoding errors 2025-11-29 19:34:27 -06:00
KnugiHK
beaf272a63 ignoreUnreadable line in vcard #173
This makes multi line entry in vcard being ignored.
2025-11-26 22:05:42 +08:00
Knugi
1d5bad92a7 Add new IV and DB entry to utility.py
Reported by @silasjelley
2025-11-07 13:13:14 +00:00
KnugiHK
da4cea6230 Change how contacts are populated from vCards (fix #167)
Enrichment is now performed before message processing to ensure that all contacts are available, regardless of whether they exist in the ChatCollection.
2025-10-12 23:18:55 +08:00
Knugi
2b8af6a2fc Merge pull request #163 from jensb/fix-162-empty-chat-names
Update vcards_contacts.py to handle enrichment of empty chat names (#162)
2025-08-19 22:35:46 +08:00
jensb
f04205cb49 Update vcards_contacts.py to handle enrichment of empty chat names. Fixes #162. 2025-08-17 23:55:32 +02:00
KnugiHK
177b936b25 Give styling to "End of history" 2025-07-27 16:28:28 +08:00
KnugiHK
101e554413 Refactor 2025-07-27 16:25:47 +08:00
KnugiHK
49851f5874 Fix overflow in reply text 2025-07-27 16:14:54 +08:00
KnugiHK
8cf1071c90 Implement media preview in reply bubble #128 2025-07-27 15:58:36 +08:00
Knugi
25fa1cc530 Merge pull request #157 from glemco/telegram_json
Add support for telegram JSON file format
2025-07-02 18:26:52 +08:00
glemco
deebd6c87e Changes after code review 2025-06-29 10:49:01 +02:00
KnugiHK
f623eddc23 Fix incorrect SQL statement
The incorrect SQL statement prevents retrieval of media information.
2025-06-19 23:13:28 +08:00
KnugiHK
5cd8d953ac Add an option to skip processing replies in iOS
Since processing replies take time
2025-06-19 22:10:12 +08:00
KnugiHK
265afc1312 Implement (blue) ticks for message status #146 2025-06-19 22:00:26 +08:00
KnugiHK
9d3e65bd92 Fix error when using not supplying a value (default) to --size 2025-06-19 21:41:03 +08:00
KnugiHK
5aa12482e0 Fix on disappearing reply feature in iOS #154 2025-06-19 21:22:20 +08:00
KnugiHK
716d4af3f3 Fix incorrect type on comparison of exception 2025-06-19 21:09:00 +08:00
KnugiHK
4742ffd858 Handle a permission error on macOS #158
Although this does not fix the issue, when the error occurs, it will provide more information to users
2025-06-19 00:10:31 +08:00
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
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
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
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