8 Commits
0.8.1 ... 0.8.2

Author SHA1 Message Date
KnugiHK
507e88d9c3 Merge branch 'dev' 2022-05-09 18:31:03 +08:00
KnugiHK
60e1e7d3eb Bump version 2022-05-09 18:28:13 +08:00
Knugi
774fb6d781 Merge pull request #11 from asla9709/dev
Fixed bug where blank VCard media_name would crash the program.
2022-05-09 10:03:04 +00:00
Aakif Aslam
3ef3b02230 Fixed bug where blank VCard media_name would crash the program. 2022-04-24 18:01:32 -04:00
Knugi
07cc0f3571 Update README.md 2022-04-04 07:57:12 +00:00
KnugiHK
a1319eb835 Exclude default conversation from results 2022-04-01 17:17:43 +08:00
KnugiHK
8cbb0af43a Oh. I missed this change 2022-03-04 14:06:19 +08:00
KnugiHK
28c4a7b99f Prepare for new function 2022-03-04 14:03:15 +08:00
5 changed files with 18 additions and 7 deletions

View File

@@ -7,6 +7,8 @@ A customizable Android and iPhone Whatsapp database parser that will give you th
**If you plan to uninstall WhatsApp or delete your WhatsApp account, please make a backup of your WhatsApp database. You may want to use this exporter again on the same database in the future as the exporter develops**
# Usage
**Usage in README may be removed in the future. Check the usage in [Wiki](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/wiki)**
**If you want to use the old release (< 0.5) of the exporter, please follow the [old usage guide](https://github.com/KnugiHK/Whatsapp-Chat-Exporter/blob/main/old_README.md#usage)**
First, install the exporter by:

View File

@@ -1 +1 @@
__version__ = "0.8.1"
__version__ = "0.8.2"

View File

@@ -78,6 +78,13 @@ def main():
dest="template",
default=None,
help="Path to custom HTML template")
parser.add_option(
"-e",
"--embedded",
dest="embedded",
default=False,
action='store_true',
help="Embed media into HTML file")
(options, args) = parser.parse_args()
if options.android and options.iphone:
@@ -167,7 +174,7 @@ def main():
messages(db, data)
media(db, data, options.media)
vcard(db, data)
create_html(data, options.output, options.template)
create_html(data, options.output, options.template, options.embedded)
else:
print(
"The message database does not exist. You may specify the path "

View File

@@ -215,7 +215,8 @@ def messages(db, data):
messages.media_caption
FROM messages
LEFT JOIN messages_quotes
ON messages.quoted_row_id = messages_quotes._id;""")
ON messages.quoted_row_id = messages_quotes._id
WHERE messages.key_remote_jid <> '-1';""")
i = 0
content = c.fetchone()
while content is not None:
@@ -414,12 +415,13 @@ def vcard(db, data):
if not os.path.isdir(base):
Path(base).mkdir(parents=True, exist_ok=True)
for index, row in enumerate(rows):
file_name = "".join(x for x in row[3] if x.isalnum())
media_name = row[3] if row[3] else ""
file_name = "".join(x for x in media_name if x.isalnum())
file_path = f"{base}/{file_name}.vcf"
if not os.path.isfile(file_path):
with open(file_path, "w", encoding="utf-8") as f:
f.write(row[2])
data[row[1]]["messages"][row[0]]["data"] = row[3] + \
data[row[1]]["messages"][row[0]]["data"] = media_name + \
"The vCard file cannot be displayed here, " \
f"however it should be located at {file_path}"
data[row[1]]["messages"][row[0]]["mime"] = "text/x-vcard"
@@ -427,7 +429,7 @@ def vcard(db, data):
print(f"Gathering vCards...({index + 1}/{total_row_number})", end="\r")
def create_html(data, output_folder, template=None):
def create_html(data, output_folder, template=None, embedded=False):
if template is None:
template_dir = os.path.dirname(__file__)
template_file = "whatsapp.html"

View File

@@ -230,7 +230,7 @@ def vcard(db, data):
print(f"Gathering vCards...({index + 1}/{total_row_number})", end="\r")
def create_html(data, output_folder, template=None):
def create_html(data, output_folder, template=None, embedded=False):
if template is None:
template_dir = os.path.dirname(__file__)
template_file = "whatsapp.html"