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
521 stars 76 forks source link

wtsexporter -a error under wakbe/extracted folder #1

Closed beckietech closed 2 years ago

beckietech commented 3 years ago

wtsexporter -a Traceback (most recent call last): File "/usr/local/bin/wtsexporter", line 11, in load_entry_point('whatsapp-chat-exporter==0.6', 'console_scripts', 'wtsexporter')() File "/home/beckibox/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 473, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/beckibox/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2843, in load_entry_point return ep.load() File "/home/beckibox/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2447, in load return self.resolve() File "/home/beckibox/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2453, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "", line 969, in _find_and_load File "", line 954, in _find_and_load_unlocked File "", line 896, in _find_spec File "", line 1147, in find_spec File "", line 1123, in _get_spec File "", line 1104, in _legacy_get_spec File "", line 444, in spec_from_loader File "", line 541, in spec_from_file_location File "/usr/local/lib/python3.5/dist-packages/whatsapp_chat_exporter-0.6-py3.5.egg/Whatsapp_Chat_Exporter/main.py", line 11 parser = OptionParser(version=f"Whatsapp Chat Exporter: {version}") ^ SyntaxError: invalid syntax

Please let me know what am I missing?

KnugiHK commented 3 years ago

It is cause by Python. I notice that you are using Python 3.5 which is an old version of Python. However, this exporter requires at least Python 3.6 to work.

beckietech commented 3 years ago

Thank you! I'll try update python and retry! May I know the uninstall command of this project?

KnugiHK commented 3 years ago

No problem.

pip3 uninstall whatsapp-chat-exporter
beckietech commented 3 years ago

thanks again! I'll do it and update.

KnugiHK commented 3 years ago

I had put python_requires='>=3.7' in setup.py. May I know how did you install the exporter?

beckietech commented 3 years ago

I installed through python3 setup.py install.

beckietech commented 3 years ago

I tried install with python3.9, and the following: python3.9 setup.py build Traceback (most recent call last): File "/home/beckibox/whace/setup.py", line 1, in import setuptools File "/usr/local/lib/python3.9/site-packages/setuptools/init.py", line 23, in from setuptools.dist import Distribution File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 34, in from setuptools import windows_support File "/usr/local/lib/python3.9/site-packages/setuptools/windows_support.py", line 2, in import ctypes File "/usr/local/lib/python3.9/ctypes/init.py", line 8, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes'

Does python3.9 work?

KnugiHK commented 3 years ago

Yes, 3.9 should works, my dev environment is Python 3.9. As per my observation, the exception was raised within setuptools, so, maybe you can try this: https://stackoverflow.com/a/48045929/9478891

beckietech commented 3 years ago

Thanks for the great work! it just worked. One thing to mention, when extracting from Android backup, there's empty media in result. May I know how to get these media files?

KnugiHK commented 3 years ago

Did you place the WhatsApp media folder in the working directory? The folder can be found in your Android phone external storage. And the file structure of the working directory be like:

Working directory
│   msgstore.db (main database)
│   wa.db (contact list) (not necessary) 
│
└─── WhatsApp (media folder extract from external storage)
│   └─── Media
│       └─── WhatsApp Images
│       └─── WhatsApp Video
│       └─── ...
│   
└─── Backups (not necessary)
│   
└─── Databases (not necessary)
beckietech commented 3 years ago

I did create the folder structure accordingly and the run result also successful. however, I only see empty folders in those media folders, may I know how did it fetch from? Thanks.

KnugiHK commented 3 years ago

You meant your WhatsApp/Media in working directory is empty?

beckietech commented 3 years ago

yes, after success, the result folder created and WhatsApp and Media, subfolders moved under it . and the media subfolders contains empty.

KnugiHK commented 3 years ago

So, you mean media file are present before the program runs, and after the program ran, no media in the media subfolder? Or all media file are not present in anytime?

beckietech commented 3 years ago

all media are not presented ,thus I wonder where media can be fetched. I also saw: Gathering contacts...(35) Gathering messages...(11/11) Gathering media...(7/7) Gathering vCards...(0/0) Creating HTML...(37/37) Everything is done!

KnugiHK commented 3 years ago

You are working on Android right? WhatsApp store its media files in your phone external storage.

If you are using adb to fetch media the path will be: /sdcard/WhatsApp
If you connect your phone to a Linux machine: mtp:/{Your phone}/Internal shared storage/WhatsApp
If you connect your phone to a Windows machine: This PC\{Your phone}\Internal shared storage/WhatsApp
beckietech commented 3 years ago

I see, thanks!