mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-05-04 11:23:41 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -5,7 +5,7 @@ except ImportError:
|
|||||||
from Whatsapp_Chat_Exporter import extract, extract_iphone
|
from Whatsapp_Chat_Exporter import extract, extract_iphone
|
||||||
from Whatsapp_Chat_Exporter import extract_iphone_media
|
from Whatsapp_Chat_Exporter import extract_iphone_media
|
||||||
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
from Whatsapp_Chat_Exporter.data_model import ChatStore
|
||||||
from Whatsapp_Chat_Exporter.utility import Crypt
|
from Whatsapp_Chat_Exporter.utility import Crypt, check_update
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
@@ -136,8 +136,20 @@ def main():
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help="Do not output html files"
|
help="Do not output html files"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--check-update",
|
||||||
|
dest="check_update",
|
||||||
|
default=False,
|
||||||
|
action='store_true',
|
||||||
|
help="Check for updates"
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Check for updates
|
||||||
|
if args.check_update:
|
||||||
|
exit(check_update())
|
||||||
|
|
||||||
|
# Sanity checks
|
||||||
if args.android and args.iphone:
|
if args.android and args.iphone:
|
||||||
print("You must define only one device type.")
|
print("You must define only one device type.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|||||||
@@ -38,6 +38,36 @@ def brute_force_offset(max_iv=200, max_db=200):
|
|||||||
for db in range(0, max_db):
|
for db in range(0, max_db):
|
||||||
yield iv, iv + 16, db
|
yield iv, iv + 16, db
|
||||||
|
|
||||||
|
def check_update():
|
||||||
|
import urllib.request
|
||||||
|
import json
|
||||||
|
from sys import platform
|
||||||
|
from .__init__ import __version__
|
||||||
|
|
||||||
|
package_url_json = "https://pypi.org/pypi/whatsapp-chat-exporter/json"
|
||||||
|
try:
|
||||||
|
raw = urllib.request.urlopen(package_url_json)
|
||||||
|
except Exception:
|
||||||
|
print("Failed to check for updates.")
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
with raw:
|
||||||
|
package_info = json.load(raw)
|
||||||
|
latest_version = tuple(map(int, package_info["info"]["version"].split(".")))
|
||||||
|
current_version = tuple(map(int, __version__.split(".")))
|
||||||
|
if current_version < latest_version:
|
||||||
|
print("===============Update===============")
|
||||||
|
print("A newer version of WhatsApp Chat Exporter is available.")
|
||||||
|
print("Current version: " + __version__)
|
||||||
|
print("Latest version: " + package_info["info"]["version"])
|
||||||
|
if platform == "win32":
|
||||||
|
print("Update with: pip install --upgrade whatsapp-chat-exporter")
|
||||||
|
else:
|
||||||
|
print("Update with: pip3 install --upgrade whatsapp-chat-exporter")
|
||||||
|
print("====================================")
|
||||||
|
else:
|
||||||
|
print("You are using the latest version of WhatsApp Chat Exporter.")
|
||||||
|
return 0
|
||||||
|
|
||||||
# iOS Specific
|
# iOS Specific
|
||||||
|
|
||||||
|
|||||||
10
setup.py
10
setup.py
@@ -11,11 +11,19 @@ setuptools.setup(
|
|||||||
name="whatsapp-chat-exporter",
|
name="whatsapp-chat-exporter",
|
||||||
version=version,
|
version=version,
|
||||||
author="KnugiHK",
|
author="KnugiHK",
|
||||||
author_email="info@knugi.com",
|
author_email="hello@knugi.com",
|
||||||
description="A Whatsapp database parser that will give you the "
|
description="A Whatsapp database parser that will give you the "
|
||||||
"history of your Whatsapp conversations in HTML and JSON.",
|
"history of your Whatsapp conversations in HTML and JSON.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
license="MIT",
|
||||||
|
keywords=[
|
||||||
|
"android", "ios", "parsing", "history","iphone", "whatsapp"
|
||||||
|
"customizable", "android-backup", "crypt12", "whatsapp-chat-exporter",
|
||||||
|
"whatsapp-export", "whatsapp-database", "whatsapp-database-parser",
|
||||||
|
"whatsapp-conversations", "iphone-backup", "crypt14", "crypt15"
|
||||||
|
],
|
||||||
|
platforms=["any"],
|
||||||
url="https://github.com/KnugiHK/Whatsapp-Chat-Exporter",
|
url="https://github.com/KnugiHK/Whatsapp-Chat-Exporter",
|
||||||
packages=setuptools.find_packages(),
|
packages=setuptools.find_packages(),
|
||||||
package_data={
|
package_data={
|
||||||
|
|||||||
Reference in New Issue
Block a user