/MMSExtractor

A Python script for extracting multimedia files (images, videos, audio) from XML backups of MMS messages, specifically tailored for backups generated by the SMS Backup & Restore app.

Primary LanguagePythonMIT LicenseMIT

MMS Extractor

This script is designed to extract multimedia files from an XML backup of MMS messages, specifically tailored for backups generated by the SMS Backup & Restore app. It supports various multimedia formats including images, videos, and audio files. Files are extracted and saved in a directory structure organized by contact names.

Prerequisites

  • Python 3.6+

Installation

  1. Clone the repository or download the source code.
  2. (Optional) It's recommended to create a virtual environment to isolate the dependencies.
  3. No additional libraries are required; the script uses only the Python Standard Library.

Usage

Run the script from the command line and provide the path to the XML file as an argument. Optionally, specify the output directory where the extracted files should be saved.

python main_script.py <path_to_xml_file> [--output <output_directory>]
  • <path_to_xml_file>: Path to the XML file containing MMS backup data. Note that this script is developed to work with XML files generated by the SMS Backup & Restore app, and compatibility with other formats is not guaranteed.
  • <output_directory>: (Optional) Directory where the extracted files will be saved. Default is extracted_files.

Example:

python3 main_script.py sms-20230625193353.xml --output extracted_media

This will extract multimedia files from the XML file sms-20230625193353.xml and save them in the extracted_media directory.

Directory Structure

Extracted files are saved in directories named after contact names. These directories are created inside the output directory. For example:

extracted_media/
│
└───John Doe/
│   │   MMS_20230625_8922.jpg
│   │   MMS_20230625_8923.mp4
│   
└───Jane Doe/
    │   MMS_20230626_9031.jpg
    │   MMS_20230626_9032.mp3

Supported MIME Types

The script supports various MIME types for multimedia files. This includes, but is not limited to, JPEG, PNG, MP4, MP3, etc. You can view or edit the supported MIME types in the mime_types.py file.

Contributing

Contributions, bug reports, and feature requests are welcome. Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.