KnugiHK / WhatsApp-Chat-Exporter

A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
https://wts.knugi.dev/
MIT License
518 stars 76 forks source link

unable to open database file #55

Closed MartenMIK closed 11 months ago

MartenMIK commented 11 months ago

Hey, thank you a lot for the work! I got an error running the script, maybe someone can help me with this:

Running the command wtsexporter -i -b "~/Library/Application Support/MobileSync/Backup/00008110-000C59623ABA801E" I get the following traceback:

Traceback (most recent call last):
  File "/Users/tabea/Desktop/whatsappExporterEnv/bin/wtsexporter", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/tabea/Desktop/whatsappExporterEnv/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/[main.py](https://main.py/)", line 271, in main
    extract_iphone_media.extract_media(args.backup)
  File "/Users/tabea/Desktop/whatsappExporterEnv/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/extract_iphone_[media.py](https://media.py/)", line 65, in extract_media
    if is_encrypted(base_dir):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tabea/Desktop/whatsappExporterEnv/lib/python3.11/site-packages/Whatsapp_Chat_Exporter/extract_iphone_[media.py](https://media.py/)", line 50, in is_encrypted
    with sqlite3.connect(os.path.join(base_dir, "Manifest.db")) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: unable to open database file

The backup is not encrypted. Navigating to cd ~/Library/Application\ Support/MobileSync/Backup/00008110-000C59623ABA801E (adding a \ to escape the white space, otherwise the same path as in the original command) I arrive in the backup folder containing, amongst other files, the expected manifest.db:

image

I copied that file to the desktop and opened it using sqlitebrowser. It showed two tables and three indices. So Manifest.db is in the expected place and after copying it I was able to open it. That makes me think something is off with the path that I pass to your script or that it doesn't have permissions to read that folder? Any ideas on next steps are much appreciated!

KnugiHK commented 11 months ago

Try these commands instead: wtsexporter -i -b ~/Library/Application\ Support/MobileSync/Backup/00008110-000C59623ABA801E, wtsexporter -i -b ~"/Library/Application Support/MobileSync/Backup/00008110-000C59623ABA801E".

MartenMIK commented 11 months ago

The top suggestion worked, thanks!

KnugiHK commented 11 months ago

I also modified the docs to address this issue.