mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-05-03 10:53:40 +00:00
feat(whatsapp_business)!: args and default values for smb
Added corresponding logic for whatsapp business and default values.
This commit is contained in:
@@ -7,7 +7,7 @@ import json
|
|||||||
import string
|
import string
|
||||||
import glob
|
import glob
|
||||||
from Whatsapp_Chat_Exporter import extract_exported, extract_iphone
|
from Whatsapp_Chat_Exporter import extract_exported, extract_iphone
|
||||||
from Whatsapp_Chat_Exporter import extract, extract_iphone_media
|
from Whatsapp_Chat_Exporter import extract, extract_iphone_media, extract_iphone_media_smb
|
||||||
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
||||||
from Whatsapp_Chat_Exporter.utility import Crypt, check_update, import_from_json
|
from Whatsapp_Chat_Exporter.utility import Crypt, check_update, import_from_json
|
||||||
from argparse import ArgumentParser, SUPPRESS
|
from argparse import ArgumentParser, SUPPRESS
|
||||||
@@ -177,6 +177,13 @@ def main():
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help="Import JSON file and convert to HTML output"
|
help="Import JSON file and convert to HTML output"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--smb",
|
||||||
|
dest="smb",
|
||||||
|
default=False,
|
||||||
|
action='store_true',
|
||||||
|
help="Use Whatsapp Business default files (iphone only)"
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Check for updates
|
# Check for updates
|
||||||
@@ -265,14 +272,23 @@ def main():
|
|||||||
vcard = extract_iphone.vcard
|
vcard = extract_iphone.vcard
|
||||||
create_html = extract.create_html
|
create_html = extract.create_html
|
||||||
if args.media is None:
|
if args.media is None:
|
||||||
args.media = "AppDomainGroup-group.net.whatsapp.WhatsApp.shared"
|
if args.smb:
|
||||||
|
args.media = "AppDomainGroup-group.net.whatsapp.WhatsAppSMB.shared"
|
||||||
|
else:
|
||||||
|
args.media = "AppDomainGroup-group.net.whatsapp.WhatsApp.shared"
|
||||||
if args.backup is not None:
|
if args.backup is not None:
|
||||||
if not os.path.isdir(args.media):
|
if not os.path.isdir(args.media):
|
||||||
extract_iphone_media.extract_media(args.backup)
|
if args.smb:
|
||||||
|
extract_iphone_media_smb.extract_media(args.backup)
|
||||||
|
else:
|
||||||
|
extract_iphone_media.extract_media(args.backup)
|
||||||
else:
|
else:
|
||||||
print("WhatsApp directory already exists, skipping WhatsApp file extraction.")
|
print("WhatsApp directory already exists, skipping WhatsApp file extraction.")
|
||||||
if args.db is None:
|
if args.db is None:
|
||||||
msg_db = "7c7fba66680ef796b916b067077cc246adacf01d"
|
if args.smb:
|
||||||
|
msg_db = "724bd3b98b18518b455a87c1f3ac3a0d189c4466"
|
||||||
|
else:
|
||||||
|
msg_db = "7c7fba66680ef796b916b067077cc246adacf01d"
|
||||||
else:
|
else:
|
||||||
msg_db = args.db
|
msg_db = args.db
|
||||||
if args.wa is None:
|
if args.wa is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user