Magnet Linker
This is an extension for Chromium browsers and Firefox that extends magnet links on websites to enable the quick adding of torrents to Transmission via the RPC API.
Any magnet links found on a page are extended with a button displayed next to the link which sends that torrent straight to your Transmission instance.
Custom HTML can be added both before and after the button element based on a search of a websites URL, as well as adjustment of the div float on the button HTML.
Getting started
Extension on the Chrome web store
Extension on the Microsoft Edge add-ons store
Add-on on the Firefox add-ons store
Once installed in your browser go to the options page and configure the extension.
Change log
Bug fix (V2.0.1)
- Bug fix: Remove active tab permission from the manifest.
New features (V2)
- Allow storage of magnets to be disabled.
- Allow found magnets in storage to not disable injected buttons.
- Full rewrite including:
- Grunt added as a task runner and all external libs now added via npm.
- Fully consolidate chromium and firefox dists.
API
Fill out the respective fields to build the URL that points to your Transmission API.
Magnet search
You can configure how magnet links are found on web pages by adding attributes or element types to search for. There are currently 2 ways that elements are found in the DOM:
by an element’s attribute
For example href will find the magnet link in an element like:
<a href="magnet:?xt=urn:btih:d540fc48eb12f2833163eed6421d449dd8f1ce1f&dn=Ubuntu+desktop+19.04+%2864bit%29" title="Download this torrent using magnet">Magnet link</a>
by an element’s type
For example code will find the magnet link in an element like:
<code class="myClass">magnet:?xt=urn:btih:d540fc48eb12f2833163eed6421d449dd8f1ce1f&dn=Ubuntu+desktop+19.04+%2864bit%29</code>
This kind of element searching is useful for searching on websites where magnet links are written out rather than linked, such as Reddit
Customise injected HTML
On a site by site basis you can customise the HTML that surrounds the injected ‘send to transmission’ button, and also the float characteristics of the div. For example, on Zooqle it’s worth setting the float to none to better position the buttons on the page. The ‘search’ parameter must match all or part of the website’s URL, so for Zooqle for example, just use ‘zooqle’.
Magnet storage
The extension has the option to store all magnets that have been sent to the transmission API so that when a page is loaded, buttons can be markes as ‘already sent’ for those links already added. Buttons can also be set to enable or disable when a corresponding magnet is founf in storage.
The Storage tab in options allows you to see all of these magnets and clear down the list if you choose.
Create package
Uses grunt as a task runner, run the following from the root directory to build:
npm i
grunt release
The grunt release config executes a Powershell script to run web-ext, this can be changed to a bash file if preferred (see comments in the Gruntfile.js).
Contribute
If you can make this extension better I’m happy for the help! Please create a pull request and get in touch. Alternatively feel free to raise an issue if you’ve found a bug or want to suggest a new feature.
To contribute, please create your PR to merge into the staging branch.