Skip to content
/ tzMCP Public

Media Capture Proxy - A safe and easy-to-use media capture tool that filters and saves web images, videos, and files using mitmproxy. Includes a full GUI, smart MIME detection, portable browser launcher, and security-focused defaults.

License

Notifications You must be signed in to change notification settings

taggedzi/tzMCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

83 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›°οΈ tzMCP - Taggedz Media Capture Proxy

tzMCP is a GUI and CLI tool that uses mitmproxy to intercept and selectively save media from web traffic β€” including images, videos, HTML, CSS, JavaScript, and other downloadable files.

It is secure-by-default, lightweight, and designed to be cross-platform and user-friendly.


✨ Features

  • βœ… GUI with Tabbed Interface
  • πŸ•΅οΈβ€β™‚οΈ Runs a MITM Proxy (mitmdump)
  • πŸ“‚ Media filtering by:
    • MIME group (e.g., image, video, html)
    • File size range
    • Pixel dimensions
    • Domain whitelists / blacklists
  • 🧠 Smart MIME detection using byte scanning (not just Content-Type)
  • 🧹 Automatic cleanup of expired logs and browser profiles
  • πŸ” Security-first:
    • Directory traversal protection
    • Executable file type warnings
    • SHA256-based deduplication
  • πŸ’¬ Real-time log stream to GUI (via internal log server)
  • πŸ§ͺ Optional persistent deduplication (SQLite-backed)
  • πŸš€ Portable browser launcher with proxy preconfiguration

πŸ–₯️ GUI Overview

  • Proxy Control Tab: Start/Stop mitmdump and view logs
  • Browser Launch Tab: Manage and launch portable browsers
  • Configuration Tab: Modify save filters, MIME groups, domain settings, and logging

πŸš€ Quick Start

1. Clone the repository

git clone https://github.com/taggedzi/tzMCP
cd tzmcp

2. Install dependencies (recommended inside a virtualenv)

pip install -r requirements.txt

Or, if installing via PyPI (coming soon):

pip install tzmcp

3. Launch the GUI

python -m tzMCP.gui

βš™οΈ Configuration

Located at: config/media_proxy_config.yaml

You can modify it via the GUI or manually.

Example config snippet:

save_dir: E:/Home/Documents/Programming/tzMCP/cache
allowed_mime_groups:
  - image
  - video
filter_pixel_dimensions:
  enabled: true
  min_width: 300
  min_height: 300
  max_width: 12000
  max_height: 12000
filter_file_size:
  enabled: true
  min_bytes: 10240         # 10KB
  max_bytes: 157286400     # 150MB
whitelist: []
blacklist:
  - ads\..*
  - .*\.doubleclick\.net
log_to_file: true
log_level: INFO
auto_reload_config: true
enable_persistent_dedup: false

πŸ”§ CLI Support

CLI is supported. Here are the parameters for the CLI.

usage: tzMCP-cli [-h] [--config CONFIG] [--save-dir SAVE_DIR] [--mime-groups [MIME_GROUPS ...]]
                 [--whitelist [WHITELIST ...]] [--blacklist [BLACKLIST ...]] [--min-bytes MIN_BYTES]
                 [--max-bytes MAX_BYTES] [--min-width MIN_WIDTH] [--max-width MAX_WIDTH] [--min-height MIN_HEIGHT]
                 [--max-height MAX_HEIGHT] [--log-to-file] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--dedup]
                 [--no-auto-reload]

tzMCP CLI Media Capture Proxy

options:
  -h, --help            show this help message and exit
  --config CONFIG       Path to YAML config file
  --save-dir SAVE_DIR   Directory to save media files
  --mime-groups [MIME_GROUPS ...]
                        List of allowed MIME groups
  --whitelist [WHITELIST ...]
                        Domain whitelist (regex or substring)
  --blacklist [BLACKLIST ...]
                        Domain blacklist (regex or substring)
  --min-bytes MIN_BYTES
                        Minimum file size in bytes
  --max-bytes MAX_BYTES
                        Maximum file size in bytes
  --min-width MIN_WIDTH
                        Minimum image width
  --max-width MAX_WIDTH
                        Maximum image width
  --min-height MIN_HEIGHT
                        Minimum image height
  --max-height MAX_HEIGHT
                        Maximum image height
  --log-to-file         Enable file logging
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set log level
  --dedup               Enable persistent deduplication
  --no-auto-reload      Disable config auto-reload

πŸ”’ Security Notes

  • MIME detection uses both extension and byte-scanning (via filetype)
  • File extensions are never guessed
  • Executables are blocked unless explicitly allowed
  • File names are sanitized to prevent directory traversal or reserved name collisions
  • SHA256 deduplication prevents accidental overwrites or re-saves

πŸ“¦ Packaging

When published on PyPI:

pip install tzmcp
tzmcp   # launch GUI (entry point)

Project Metadata

  • Python version: 3.8+

  • Platform: Windows, Linux, macOS (via tkinter + mitmproxy)

  • License: MIT

  • Dependencies:

    • mitmproxy
    • Pillow
    • filetype
    • psutil
    • pyyaml
    • watchdog
    • requests

πŸ“ Folder Layout

β”œβ”€β”€ .github\
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .pylintrc
β”œβ”€β”€ .treeignore
β”œβ”€β”€ cache\
β”œβ”€β”€ config\
β”‚   β”œβ”€β”€ browser_paths.yaml
β”‚   └── media_proxy_config.yaml
β”œβ”€β”€ docs\
β”œβ”€β”€ LICENSE
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ scripts\
β”‚   β”œβ”€β”€ clean_unused_packages.py
β”‚   └── tree_maker.py
β”œβ”€β”€ src\
β”‚   β”œβ”€β”€ config\
β”‚   β”‚   └── browser_paths.yaml
β”‚   └── tzMCP\
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ browser_plugins\
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ brave.py
β”‚       β”‚   β”œβ”€β”€ chrome.py
β”‚       β”‚   β”œβ”€β”€ firefox.py
β”‚       β”‚   β”œβ”€β”€ iron.py
β”‚       β”‚   β”œβ”€β”€ kmeleon.py
β”‚       β”‚   β”œβ”€β”€ librewolf.py
β”‚       β”‚   β”œβ”€β”€ opera.py
β”‚       β”‚   β”œβ”€β”€ seamonkey.py
β”‚       β”‚   └── vivaldi.py
β”‚       β”œβ”€β”€ cli.py
β”‚       β”œβ”€β”€ common_utils\
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ cleanup_logs.py
β”‚       β”‚   β”œβ”€β”€ cleanup_profiles.py
β”‚       β”‚   └── log_config.py
β”‚       β”œβ”€β”€ gui.py
β”‚       β”œβ”€β”€ gui_bits\
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ app_constants.py
β”‚       β”‚   β”œβ”€β”€ browser_launcher.py
β”‚       β”‚   β”œβ”€β”€ browser_tab.py
β”‚       β”‚   β”œβ”€β”€ config_manager.py
β”‚       β”‚   β”œβ”€β”€ config_tab.py
β”‚       β”‚   β”œβ”€β”€ log_server.py
β”‚       β”‚   β”œβ”€β”€ proxy_control.py
β”‚       β”‚   β”œβ”€β”€ proxy_tab.py
β”‚       β”‚   └── status_bar.py
β”‚       β”œβ”€β”€ save_media.py
β”‚       └── save_media_utils\
β”‚           β”œβ”€β”€ __init__.py
β”‚           β”œβ”€β”€ config_provider.py
β”‚           β”œβ”€β”€ gen_whitelist_regex.py
β”‚           β”œβ”€β”€ hash_tracker.py
β”‚           β”œβ”€β”€ mime_categories.py
β”‚           β”œβ”€β”€ mime_data_minimal.py
β”‚           └── save_media_utils.py
β”œβ”€β”€ tasks.py
└── tests\

πŸ§ͺ Testing (Coming Soon)

We're planning unit tests for:

  • config validation
  • MIME filters
  • duplicate handling
  • CLI interface

πŸ“ License

MIT License. See LICENSE file for full text.


πŸ™Œ Acknowledgements

  • Built on top of mitmproxy
  • Inspired by the need for a safe, auditable web media capture tool

Leagal

Please understand and read the terms of this software before using it. They are located here: CYA_NOTICE.md.

About

Media Capture Proxy - A safe and easy-to-use media capture tool that filters and saves web images, videos, and files using mitmproxy. Includes a full GUI, smart MIME detection, portable browser launcher, and security-focused defaults.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Languages