MLTSHP Image Saver

Adds download buttons to save MLTSHP images with their post titles as filenames

Autor
Dan Cutts
Instalaciones diarias
0
Instalaciones totales
2
Calificaciones
0 0 0
Versión
0.1.1
Creado
22/4/2025
Actualizado
22/4/2025
Tamaño
29,8 KB
Licencia
MIT
Funciona en

# MLTSHP Image Saver

A Tampermonkey script that adds download buttons to images on [MLTSHP](https://mltshp.com), allowing you to save images with their post titles as filenames.

![MLTSHP Image Saver Screenshot](https://i.imgur.com/example.png) *(Replace with actual screenshot)*

## Features

- **Smart Title Detection**: Automatically identifies and uses post titles as filenames when saving images
- **Integration with MLTSHP UI**: Adds download buttons alongside existing MLTSHP "Save" buttons
- **Fallback Positioning**: Places buttons directly on images when standard UI buttons aren't available
- **Smart Image Filtering**: Ignores logos, small icons, and non-MLTSHP images
- **Automatic Operation**: Works immediately after installation with no configuration needed
- **Floating Control Button**: Includes a force-add button for edge cases
- **Toggle On/Off**: Easily disable or enable the script via the Tampermonkey menu
- **Selective Operation**: Does not run on direct CDN image pages (https://mltshp-cdn.com/r/*)

## Installation

1. Install the [Tampermonkey](https://www.tampermonkey.net/) extension for your browser:
- [Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo)
- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/)
- [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd)
- [Safari](https://apps.apple.com/app/tampermonkey/id1482490089)

2. Install the MLTSHP Image Saver script:
- Click [here](https://github.com/yourusername/mltshp-image-saver/raw/main/mltshp-image-saver.user.js) to install directly
- Or copy the script contents and create a new script in Tampermonkey dashboard

## How It Works

The script works by:

1. **Mapping Images to Titles**: The script scans the page and maps each image to its most relevant title based on proximity and context
2. **Adding Download Buttons**: It adds a green "Download" button for each image, either:
- Next to the MLTSHP "Save" button when available
- Directly on the image when no standard save button is found
3. **Smart Downloading**: When clicked, it downloads the image using the mapped title as the filename

## Usage

Once installed, the script runs automatically on MLTSHP pages (excluding direct CDN image URLs):

- **Download an Image**: Click the green "Download" button next to any image to save it with its title as the filename
- **Force Add Buttons**: If buttons don't appear, click the orange "Force Add Buttons" in the top-right corner
- **Toggle the Script**: Use the Tampermonkey menu to enable/disable the script temporarily

## Troubleshooting

- **No buttons appear**: Click the "Force Add Buttons" control in the top-right corner
- **Script conflicts with other extensions**: Try disabling other userscripts temporarily
- **Images download without proper titles**: The script might not be able to detect the title; try clicking the image to view it on its own page
- **Not working on direct image pages**: The script intentionally doesn't run on direct CDN image URLs (https://mltshp-cdn.com/r/*) as these pages don't have titles to extract

## Customization

You can edit the script to:
- Change button colors and appearance
- Adjust button positioning
- Toggle debug mode (set `DEBUG = true` for detailed console logging)
- Modify image filtering rules
- Change which pages the script runs on by editing the @match and @exclude rules

## Privacy & Permissions

This script:
- Only runs on MLTSHP domains (excluding direct CDN image pages)
- Does not collect or transmit any data
- Only downloads images you explicitly click on
- Operates entirely within your browser

## License

MIT License - Feel free to modify and share!