GUIDE How to send torrents directly to your docker-transmission-openvpn instance in windows #3024
new112211
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I’m running docker-transmission-openvpn inside a docker instance on a NAS. This script allows me to do the following:
Click magnet link → torrent appears on server instantly
Whenever I click on a MAGNET URL anywhere on my PC or on any website, the URL magnet torrent is captured and sent automatically to my client running on my NAS. No popups, browser tabs, or manual copying and pasting.
I created this because a useful browser extension, that I previously used to automatically add torrents to my client when clicking on magnet links, had stopped working. (google’s fault not the dev’s). After this, I became tired of copying and pasting the links or having to keep my client open/running on my PC just for it to remotely add magnets.
This is a direct magnet to transmission RPC integration, that allows you to set windows to use your remote transmission client, that’s running on your NAS, as the default URL protocol handler for windows.
Meaning, when you click on a magnet link, windows automatically sends and adds it to your remote transmission client. Done, simple effective and fast! No browser extensions, no switching between tabs, no local torrent clients running on your PC, or browser JavaScript hacks, needed.
What This Does
This system creates a custom Windows protocol handler for magnet URLs. The magnet link gets sent directly to Transmission RPC API.
Supports:
• timestamped logging
• automatic log cleanup (after 30 days)
• RPC error logging
• duplicate detection
WORK FLOW
Magnet Link Clicked
↓
Windows Protocol Handler
↓
VBScript Launcher
↓
PowerShell RPC Script
↓
Transmission RPC API
↓
Torrent Added To Client
Installation Guide/Requirements
Tested on windows 10
Transmission RPC Enabled needs to be enabled, if not already.
Example docker environment variables:
INSTALLATION GUIDE
Its super simple and quick, this guide just makes it look longer as I tried to put as much information as I could.
If you currently have a program already associated with magnet links, to register with windows this new script, you’ll have to clear the ones you set. You can check this in
If its blank, you can skip this step, otherwise delete the following keys in the registry:
Create Folder Structure on your PC _(if you use your own locations, don’t forget to update the files to reflect change)
a. Create:
C:\Scripts\protocol-handler-URL-magnet\Create PowerShell Script
a. Create:
C:\Scripts\protocol-handler-URL-magnet\add-magnet.ps1This script:
b. be sure to change the following
i. the USERNAME & PASSWORD
ii. Your remote IP & port XXXX to access your docker transmission
- $rpcUrl = "http://XXX.X.X.X:XXXX/transmission/rpc/"The “rpc/” is required in your url as detailed in the documentation for “VPN and Networking” in this repository wiki (I was stuck on this for a while)
https://haugene.github.io/docker-transmission-openvpn/vpn-networking/
Create VBScript Launcher
a. Create:
C:\Scripts\protocol-handler-URL-magnet\magnet-launcher.vbsCreate Registry file
a. Create:
C:\Scripts\protocol-handler-URL-magnet\register-magnet-launcher.regThis does:
Import Registry File
Import register-magnet-launcher.reg into your registry to tell windows to use your custom script to handle magnet protocols
Reboot windows
REQUIRED
If you’d like to check if the registry was updated correctly run
reg query "HKEY_CURRENT_USER\Software\Classes\magnet\shell\open\command"in cmd.Result should show
(Default) REG_SZ wscript.exe "C:\Scripts\protocol-handler-URL-magnet\magnet-launcher.vbs" "%1"a. click on a magnet link and in the popup that asks “How do you want to open this file” select Either “Microsoft Windows Based Script Host” or the name of your custom launcher/script and enable the check box: "
Always use this app”b. Or instead Manually set it in the settings, same as step 1, select Microsoft Windows Based Script Host
Done. Now next time you click a magnet link, it’ll be instantly (almost) added to your remote torrent client, with audible feedback notifications. Event logging enabled if required. Log will be saved to the same location
SECURITY NOTES
Do NOT expose Transmission RPC directly to the internet.
Recommended:
• restrict RPC access to LAN only
TESTING:
To check if your client PowerShell RPC script itself actually works, before putting it into production,
Run in powershell using a dummy test torrent
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\protocol-handler-URL-magnet\add-magnet.ps1" "magnet:?xt=urn:btih:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"should return
or similar, then it works
if it returns
{"result":"unrecognized info"}, then there’s an issue with the RPC layerOriginally took inspiration from fatflyingpigs who posted a great solution to a kind-of similar issue, I just took it in a completely different direction
fatflyingpigs on Jan 17, 2023
qbittorrent/qBittorrent#12605 (comment)
Had some help from chatgbt
Also just wanted to say, its amazing the work people put in to create this amazing repository. Thank you! 😊
Also sorry if the guides not quite correct, it’s the first I’ve written but hopefully its been of some help.
The required files:
### magnet-launcher.vbs
register-magnet-launcher.reg
add-magnet.ps1
All reactions