Package: whatsapp-chat-exporter
Whatsapp-Chat-ExporterA customizable Android and iPhone Whatsapp database parser that will give you the history of your Whatsapp conversations in HTML and JSON. Inspired byTelegram Chat Export Tool.If you plan to uninstall WhatsApp or delete your WhatsApp account, please make a backup of your WhatsApp database. You may want to use this exporter again on the same database in the future as the exporter developsUsageUsage in README may be removed in the future. Check the usage inWiki.If you want to use the old release (< 0.5) of the exporter, please follow theold usage guide.First, install the exporter by:pipinstallwhatsapp-chat-exporter
pipinstallwhatsapp-chat-exporter[android_backup]:;# Optional, if you want it to support decrypting Android WhatsApp backup.Then, create a working directory in somewhere you wantmkdirworking_wtscdworking_wtsWorking with AndroidUnencrypted WhatsApp databaseExtract the WhatsApp database with whatever means, one possible means is to use theWhatsApp-Key-DB-ExtractorAfter you obtain your WhatsApp database, copy the WhatsApp database and media folder to the working directory. The database is called msgstore.db. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.And now, you should have something like this in the working directory.ExtractingSimply invoke the following command from shell.wtsexporter-aEncrypted Android WhatsApp BackupIn order to support the decryption, install pycryptodome if it is not installedpipinstallpycryptodome# Orpipinstallwhatsapp-chat-exporter["android_backup"]# install along with this softwareCrypt15 is now the easiest way to decrypt a backup. If you have the 32 bytes hex key generated when you enable End-to-End encrypted backup, you can use it to decrypt the backup. If you do not have the 32 bytes hex key, you can still use the key file extracted just like extacting key file for Crypt12 and Crypt14 to decrypt the backup.Crypt12 or Crypt14You will need the decryption key file from your phone. If you have root access, you can find it as/data/data/com.whatsapp/files/key. Otherwise, if you used WhatsApp-Key-DB-Extractor before, it will appear in the WhatsApp backup directory asWhatsApp/Databases/.nomedia.Place the decryption key file (key) and the encrypted WhatsApp Backup (msgstore.db.crypt14) in the working directory. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.And now, you should have something like this in the working directory.ExtractingSimply invoke the following command from shell.wtsexporter-a-kkey-bmsgstore.db.crypt14Crypt15 (End-to-End Encrypted Backup)To support Crypt15 backup, install javaobj-py3 if it is not installedpipinstalljavaobj-py3# Orpipinstallwhatsapp-chat-exporter["crypt15"]# install along with this softwarePlace the encrypted WhatsApp Backup (msgstore.db.crypt15) in the working directory. If you also want the name of your contacts, get the contact database, which is called wa.db. And copy the WhatsApp (Media) directory from your phone directly.If you do not have the 32 bytes hex key (64 hexdigits), place the decryption key file (encrypted_backup.key) extracted from Android. If you gave the 32 bytes hex key, simply put the key in the shell.Now, you should have something like this in the working directory (if you do not have 32 bytes hex key).ExtractingIf you do not have 32 bytes hex key but have the key file available, simply invoke the following command from shell.wtsexporter-a-kencrypted_backup.key-bmsgstore.db.crypt15If you have the 32 bytes hex key, simply put the hex key in the -k option and invoke the command from shell like this:wtsexporter-a-k432435053b5204b08e5c3823423399aa30ff061435ab89bc4e6713969cdaa5a8-bmsgstore.db.crypt15Working with iOS/iPadOS (iPhone or iPad)Do an iPhone/iPad Backup with iTunes first.iPhone backup on Mac:https://support.apple.com/HT211229iPhone backup on Windows:https://support.apple.com/HT212156iPad backup:https://support.apple.com/guide/ipad/ipad9a74df05xx/ipadosEncrypted iOS/iPadOS BackupIf you are working on unencrypted iOS/iPadOS backup, skip thisIf you want to work on an encrypted iOS/iPadOS Backup, you should install iphone_backup_decrypt fromKnugiHK/iphone_backup_decryptbefore you run the extract_iphone_media.py.pipinstallgit+https://github.com/KnugiHK/iphone_backup_decryptExtractingSimply invoke the following command from shell, remember to replace the username and device id correspondingly in the command.Windowswtsexporter-i-b"C:\Users\[Username]\AppData\Roaming\Apple Computer\MobileSync\Backup\[device id]"Macwtsexporter-i-b~/Library/Application\Support/MobileSync/Backup/[deviceid]ResultsAfter extracting, you will get these:Private MessageGroup MessageMore optionsInvoke the wtsexporter with --help option will show you all options available.>wtsexporter--help
usage:wtsexporter[-h][-a][-i][-eEXPORTED][-wWA][-mMEDIA][-bBACKUP][-oOUTPUT][-j[JSON]][-dDB][-kKEY][-tTEMPLATE][-s][-c][--offlineOFFLINE][--size[SIZE]][--no-html][--check-update][--assume-first-as-me]options:-h,--helpshowthishelpmessageandexit-a,--androidDefinethetargetasAndroid-i,--iphone,--iosDefinethetargetasiPhone/iPad-eEXPORTED,--exportedEXPORTEDDefinethetargetasexportedchatfileandspecifythepathtothefile-wWA,--waWAPathtocontactdatabase(default:wa.db/ContactsV2.sqlite)-mMEDIA,--mediaMEDIAPathtoWhatsAppmediafolder(default:WhatsApp)-bBACKUP,--backupBACKUPPathtoAndroid(mustbeusedtogetherwith-k)/iPhoneWhatsAppbackup-oOUTPUT,--outputOUTPUTOutputtospecificdirectory(default:result)-j[JSON],--json[JSON]SavetheresulttoasingleJSONfile(defaultifpresent:result.json)-dDB,--dbDBPathtodatabasefile(default:msgstore.db/7c7fba66680ef796b916b067077cc246adacf01d)-kKEY,--keyKEYPathtokeyfile-tTEMPLATE,--templateTEMPLATEPathtocustomHTMLtemplate-s,--showkeyShowtheHEXkeyusedtodecryptthedatabase-c,--move-mediaMovethemediadirectorytooutputdirectoryiftheflagisset,otherwisecopyit--offlineOFFLINERelativepathtoofflinestaticfiles--size[SIZE],--output-size[SIZE],--split[SIZE]Maximum(rough)sizeofasingleoutputfileinbytes,0forauto--no-htmlDonotoutputhtmlfiles--check-updateCheckforupdates(requireInternetaccess)--assume-first-as-meAssumethefirstmessageinachatassentbyme(mustbeusedtogetherwith-e)WhatsAppChatExporter:0.9.7LicensedwithMITTo doSeeissues.CopyrightThis is a MIT licensed project.The Telegram Desktop's export is the reference for whatsapp.html in this repo.bplist.py was released by Vladimir "Farcaller" Pouzanov under MIT license.WhatsApp Chat Exporter is not affiliated, associated, authorized, endorsed by, or in any way officially connected with the WhatsApp LLC, or any of its subsidiaries or its affiliates. The official WhatsApp LLC website can be found athttps://www.whatsapp.com/.