Magnet Link Handler for qBittorrent WebUI

Intercept magnet links and open qBittorrent download dialog in a popup.

当前为 2025-01-24 提交的版本,查看 最新版本

作者
down_to_earth
评分
0 0 0
版本
1.1
创建于
2025-01-24
更新于
2025-01-24
大小
6.0 KB
许可证
MIT
适用于
所有网站

Description

This user script enhances the handling of magnet links by intercepting clicks on magnet: links and redirecting them to the qBittorrent WebUI's /download.html page. It also automatically fills the magnet link into the textarea on the /download.html page and ensures the popup closes properly after adding the torrent.

The script is designed to work seamlessly with qBittorrent's WebUI and provides a user-friendly way to add magnet links directly from any webpage.


Features

  • Intercepts Magnet Links: Automatically detects and handles clicks on magnet: links.
  • Opens qBittorrent WebUI: Opens the qBittorrent WebUI's /download.html page in a centered popup.
  • Auto-Fills Magnet Link: Automatically pastes the magnet link into the textarea on the /download.html page.
  • Configurable WebUI URL: Allows you to set the qBittorrent WebUI URL via a Tampermonkey menu command.
  • Handles Dynamic Content: Works with dynamically added content and magnet links inside iframes (same origin only).
  • Popup Closing: Ensures the popup closes after adding the torrent by overriding window.parent.closeWindows or using postMessage as a fallback.

Usage

  1. Set qBittorrent WebUI URL:

    • Click the Tampermonkey icon in your browser toolbar.
    • Select the script name (e.g., "qBittorrent WebUI Magnet Link Handler").
    • Click "Set qBittorrent WebUI URL" and enter the URL of your qBittorrent WebUI (e.g., http://localhost:8080).
  2. Click Magnet Links:

    • Click on any magnet: link on any webpage.
    • A popup will open with the qBittorrent WebUI's /download.html page, and the magnet link will be automatically filled into the textarea.
  3. Add Torrent:

    • Click the "Download" button in the qBittorrent download dialog to add the torrent.
    • The popup will close automatically after adding the torrent.

Configuration

  • Default WebUI URL: http://localhost:8080
  • Custom WebUI URL: Use the Tampermonkey menu command to set a custom URL.

Compatibility

  • Browsers: Works on all major browsers with Tampermonkey support (Chrome, Firefox, Edge, etc.).
  • qBittorrent WebUI: Compatible with qBittorrent WebUI versions that include the /download.html page.

Feel free to customize this description further to suit your needs! Let me know if you need additional details or modifications.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址