def main():
	backup_folder = get_backup_folder()
	if backup_folder is None:
		print("Could not find backup folder")
		sys.exit()

	mbdb_file = os.path.join(backup_folder, "Manifest.mbdb")

	files_in_backup = mbdb.process_mbdb_file(mbdb_file)

	whatsapp_chat_file = None
	for f in files_in_backup:
		if f['domain'] == b"AppDomain-net.whatsapp.WhatsApp" and f['filename'] == b"Documents/ChatStorage.sqlite":
			whatsapp_chat_file = f['fileID']

	if whatsapp_chat_file is None:
		print("Could not find WhatsApp Chat file")
		sys.exit()

	whatsapp_chat_file = os.path.join(backup_folder, str(whatsapp_chat_file))
	shutil.copy(whatsapp_chat_file, chat_output.CHAT_STORAGE_FILE)

	chat_output.main()

	os.remove(chat_output.CHAT_STORAGE_FILE)
def main():
	backup_extractor = BackupExtractor()

	whatsapp_chat_file = backup_extractor.get_file_path("AppDomain-net.whatsapp.WhatsApp", "Documents/ChatStorage.sqlite")

	if whatsapp_chat_file is None:
		print("Could not find WhatsApp Chat file")
		sys.exit()

	shutil.copy(whatsapp_chat_file, chat_output.CHAT_STORAGE_FILE)

	chat_output.main()

	os.remove(chat_output.CHAT_STORAGE_FILE)
def main():
    backup_extractor = BackupExtractor()

    whatsapp_chat_file = backup_extractor.get_file_path(
        "AppDomain-net.whatsapp.WhatsApp", "Documents/ChatStorage.sqlite")

    if whatsapp_chat_file is None:
        print("Could not find WhatsApp Chat file")
        sys.exit()

    shutil.copy(whatsapp_chat_file, chat_output.CHAT_STORAGE_FILE)

    chat_output.main()

    os.remove(chat_output.CHAT_STORAGE_FILE)