Overview
Media dumping extracts all WhatsApp media files from the device’s storage, preserving the directory structure for proper organization and HTML export compatibility. This includes images, videos, voice messages, audio files, documents, and other attachments.Media Extraction Workflow
Media extraction is integrated into the backup dumping process:Triggering Media Extraction
During backup dumping inmain.py:299:
WhatsApp Media Folder Structure
WhatsApp organizes media into category-specific subdirectories:Standard Media Paths
WhatsApp Messenger:Android 11+ Media Paths
Android 11 introduced scoped storage, moving app media to the
Android/media/ directory.Media Discovery
Thefind_media() method in core/device_manager.py:215 locates media folders:
The tool checks both legacy and modern paths, returning the first valid location found.
dump_media_with_progress() Implementation
The core extraction method incore/device_manager.py:254:
File Counting
Using
find -type f | wc -l provides an accurate file count for progress tracking.Recursive Pull with Progress Bar
The progress bar updates by parsing ADB’s output lines that indicate file transfers.
Media Types Extracted
Images
JPEG, PNG, WebP photos from chats and status
Videos
MP4, 3GP video messages and status videos
Audio
MP3, AAC, OGG audio files shared in chats
Voice Notes
Opus-encoded voice messages
Documents
PDF, DOC, XLS, ZIP and other file types
GIFs
Animated GIF files
Stickers
WebP sticker files
Profile Photos
Contact and group profile pictures
Directory Structure Preservation
The tool maintains WhatsApp’s original structure:Preserving the structure ensures media links in HTML exports work correctly.
Media Linking to Chat Exports
HTML chat exports reference media using relative paths:HTML Media Embed Code
Fromcore/viewer.py:666:
The relative path
../Media/WhatsApp Images/... allows the HTML file to locate media regardless of where the backup folder is moved.Storage Requirements
Media extraction can require substantial disk space:Light User
500MB - 2GB
Few photos and videos
Few photos and videos
Average User
2GB - 10GB
Regular media sharing
Regular media sharing
Heavy User
10GB - 50GB+
Extensive video and photo collection
Extensive video and photo collection
Deduplication Handling
The tool prevents duplicate media extraction per user/package:This ensures media is only downloaded once even when multiple database backups are selected from the same user/package.
Performance Considerations
Transfer Speed Factors
- USB 2.0: ~10-30 MB/s (slower)
- USB 3.0: ~50-100 MB/s (recommended)
- File Size: Many small files are slower than fewer large files
- Device Performance: Older devices may have slower storage access
Optimization Tips
Incomplete Extraction Handling
The method returns a boolean indicating success:Incomplete extraction may occur due to:
- Device disconnection
- Insufficient permissions for certain files
- Storage space exhaustion
- User cancellation (Ctrl+C)
Permissions and Access
Required Permissions
Read Storage
ADB must have access to storage paths
USB Debugging
Must remain enabled during extraction
Screen Unlocked
Some devices require screen to stay unlocked
No Password Prompt
File access shouldn’t require additional authorization
Android 11+ Considerations
On Android 11+, WhatsApp must have “All files access” permission for the legacy path to be readable.
Media File Naming Convention
WhatsApp uses standardized naming:- Images:
IMG-YYYYMMDD-WA####.jpg - Videos:
VID-YYYYMMDD-WA####.mp4 - Audio:
AUD-YYYYMMDD-WA####.mp3 - Voice:
PTT-YYYYMMDD-WA####.opus - Documents:
DOC-YYYYMMDD-WA####.{ext}
YYYYMMDD: Date received/sentWA####: Sequential WhatsApp number{ext}: Original file extension
Files are automatically organized by type through subdirectories, making manual sorting unnecessary.
Troubleshooting
No media folder found
No media folder found
- Ensure WhatsApp has been used to send/receive media
- Check that storage permissions are granted to WhatsApp
- Media may be stored on SD card (not supported via ADB)
- Try manual backup creation in WhatsApp to populate folders
Permission denied errors
Permission denied errors
- Grant “Files and media” permission to WhatsApp in Android Settings
- On Android 11+, grant “All files access” in Special app access
- Some manufacturers restrict ADB access to certain paths
- Root access may be required on heavily locked devices
Extraction stuck or very slow
Extraction stuck or very slow
- Check USB cable quality (use official or high-quality cable)
- Switch to a different USB port (preferably USB 3.0)
- Disable USB selective suspend in Windows power settings
- Restart ADB server:
adb kill-server && adb start-server - Consider extracting smaller batches or specific folders only
Media not appearing in HTML export
Media not appearing in HTML export
- Verify Media folder exists alongside exports folder
- Check that database references match actual filenames
- Some media may have been deleted from device but references remain
- Ensure HTML file and Media folder maintain relative structure
Manual Selective Extraction
For advanced users who need only specific media types:Next Steps
Chat Export
Export chats with embedded media links
Database Viewer
View which media files are referenced in messages
