AuntMia Gallery Image Downloader

创建于 4 天前
更新于 4 天前
Add a download button to save images locally in AuntMia gallery slideshows
总安装量
11
今日新增
+0
用户评分
- / 5.0 (0)
当前版本
0.2.0
脚本详情
适用网站

AuntMia Gallery Image Downloader

A Tampermonkey userscript that adds a local download button to image galleries on auntmia.com, allowing you to save images directly to your computer instead of opening them in a new tab.

Features

  • 🎯 One-Click Download - Save images directly to your local computer with a single click
  • 🖼️ Slideshow Integration - Seamlessly integrates with the existing slideshow viewer
  • 🔄 Auto-Update - Download button automatically updates when switching between images
  • 🌐 CORS Bypass - Uses GM_xmlhttpRequest to bypass cross-origin restrictions
  • 💾 Smart Filename - Automatically preserves original image filenames
  • Visual Feedback - Clear status indicators (loading, success, error states)
  • 🛡️ Fallback Mode - Opens image in new tab if direct download fails

Installation

Prerequisites

  1. Install a userscript manager:

Steps

  1. Click the raw link for auntmia-gallery-downloader.user.js
  2. Your userscript manager should prompt you to install the script
  3. Click "Install" to complete the installation

Alternatively, you can manually create a new script in your userscript manager and paste the script content.

Usage

  1. Visit any gallery page on auntmia.com
  2. Click the "▶ Slideshow" button to start the slideshow
  3. You'll see a new download button (⬇ icon) in the toolbar
  4. Click the download button to save the current image to your computer
  5. Navigate through images using the slideshow controls - the download button will automatically update for each image

Button Legend

Icon Meaning
Ready to download
Download in progress
Download successful
! Download failed (click to open in new tab)

Technical Details

Permissions

The script requires the following permissions:

  • GM_xmlhttpRequest - For bypassing CORS restrictions when downloading images
  • GM_download - For direct file downloads (fallback)
  • @connect - For accessing image domains (auntmia.com, doppiocdn.com, etc.)

Browser Compatibility

  • ✅ Chrome/Edge (with Tampermonkey)
  • ✅ Firefox (with Tampermonkey/Greasemonkey)
  • ✅ Safari (with Tampermonkey)
  • ⚠️ Opera (with Tampermonkey - may require additional configuration)

How It Works

  1. DOM Observation: Uses MutationObserver to detect when the lightgallery slideshow is initialized
  2. Button Injection: Adds a download button to the lightgallery toolbar
  3. Image Tracking: Monitors slide changes to update the download target
  4. CORS Bypass: Uses GM_xmlhttpRequest to fetch image data directly, bypassing browser CORS restrictions
  5. Blob Download: Creates a blob URL and triggers a browser download with the correct filename

Troubleshooting

Download button not appearing

  • Make sure Tampermonkey is enabled
  • Check that the script is active for the current domain
  • Try refreshing the page
  • Check the browser console for errors

Downloads failing

  • Check your browser's download permissions
  • Make sure no download managers are intercepting the downloads
  • Try clicking "OK" when prompted to open the image in a new tab
  • Check the browser console for specific error messages

Script not updating

  • Uninstall the old version first, then install the new one
  • Or manually edit the script in your userscript manager

Version History

v2.0 (Current)

  • ✨ Complete rewrite with improved reliability
  • 🐛 Fixed CORS issues using GM_xmlhttpRequest
  • 🎨 Replaced text icon with professional SVG icon
  • 🔧 Improved integration with existing toolbar
  • 🛡️ Added fallback mode for failed downloads

v1.0

  • Initial release
  • Basic download functionality

Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

License

This script is provided as-is for personal use. Please respect the website's terms of service and copyright policies when downloading content.

Disclaimer

This userscript is for educational purposes only. Always respect copyright laws and the website's terms of service. The author is not responsible for any misuse of this tool.

Support

If you encounter any issues or have suggestions, please:

  1. Check the Troubleshooting section
  2. Report bugs with details about your browser and userscript manager versions
  3. Include any error messages from the browser console

Made with ❤️ for better browsing experience