Torrent magnet links open new window but not transmission
Solution 1
If you want to use torrent to transmission, you have to allow remote access in transmission under preferences/remote.
If you want to open magnet links in transmission by clicking on them, you need to patch the /usr/bin/xdg-open script, here's mine for reference. The added lines are 311 and 490-493.
Solution 2
You can change the default handler for magnet links by editing the file .local/share/applications/mimeapps.list. Add the association to the two sections in the file like this (leaving other entries in those sections intact):
[Default Applications]
x-scheme-handler/magnet=transmission-gtk.desktop
[Added Associations]
x-scheme-handler/magnet=transmission-gtk.desktop
Log out and log back in for the change to take effect.
Solution 3
If you have installed transmission-gtk
then the solution is easy.
gconftool-2 -s /desktop/gnome/url-handlers/magnet/command '/usr/bin/transmission-gtk %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/magnet/enabled --type Boolean true
The first one adds transmission-gtk
as handler for magnet://
links the second enable it.
Since chrome/ium uses xdg-open
this is the best method for setting the handlers. You can replace /usr/bin/transmission-gtk
for any client you like. This works for almost all flavors of Ubuntu.
You can test this issuing in the terminal xdg-open "magnet:?xt=urn:btih:f41989f9797a88505f9e258d5e5d1354c3731a99"
(downloads Ubuntu 13.04 64-bit)
Other solution is using xdg-mime
:
xdg-mime default transmission-gtk.desktop application/x-bittorrent
xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet
In case you don't have the mime-types installed use xdg-mime install x-scheme-handler/magnet
.
Related videos on Youtube
![Quinn Culver](https://i.stack.imgur.com/MmDaQ.jpg?s=256&g=1)
Quinn Culver
Updated on September 18, 2022Comments
-
Quinn Culver almost 2 years
I've installed Ubuntu and Lubuntu a few times now and some of those times I've had the following problem, which I currently have. When I click a torrent magnet link in Chrome (usually from Pirate bay), instead of opening transmission, the only thing that happens is a new Chrome window opens.
Upon other installations, I've not had this problem; transmission opened just as I'd like.
I've tried using Chrome's extension .torrent to Transmission, but I get the error
unable to contact http ://localhost:9091/transmission/rpc
no response
-
Admin almost 11 yearsNote: I'm using Lubuntu 13.04.
-
Admin almost 11 yearsNote: Firefox correctly handles magnet links.
-
Admin almost 11 years@BiggJJ I tried following Chan-Ho Suh's solution there, but to no avail.
-
Admin almost 11 yearsWhat version of Google chrome are you running? I use Google Chrome 28.0.1500.71 and it correctly handles magnet links withot to do nothing.
-
Admin almost 11 yearsYou are trying to open a
magnet://
link, or downloading a proper.torrent
file? -
Admin almost 11 years@Braiam A magnet.
-
Admin almost 11 yearsjust press right click in magnet link and copy it after that go to transsmion program and but it on it
-
Admin almost 11 years@Mahmoud20070 That works, thanks. But it's still sub-optimal since I'd prefer to just be able to click in Chrome and have Transmission opened automatically with the torrent.
-
Admin almost 11 yearsCan you post
cat /usr/share/app-install/desktop/chrome.desktop | grep MimeType
andcat /usr/share/application/chrome.desktop | grep MimeType
? -
Admin almost 11 years
cat: /usr/share/app-install/desktop/chrome.desktop: No such file or directory
andcat: /usr/share/application/chrome.desktop: No such file or directory
-
Admin almost 11 yearsOk, lets try to start clean, uninstall all transmission packages
apt-get purge transmission*
and install justtransmission-gtk
. I've tested again and I just don't see where things went wire. -
Admin almost 11 years@Braiam I re-installed transmission (per your suggestion) but am still having the same problem.
-
Admin about 9 yearsThis happened to me (on Ubuntu 14.04.2 LTS) when Chromium was set as my default browser. If Firefox was set as my default browser, then Chromium instead started up a new empty tab in Firefox.
-
-
j0h almost 11 yearsomgchrome.com/install-google-chrome-in-ubuntu-13-10 This claims there is a dependency issues.
-
j0h almost 11 years
-
Quinn Culver almost 11 yearsI tried this but I hasn't seemed to work. Still chrome just opens a new browser (or a new tab separate from the others; however you wanna put it).
-
Braiam almost 11 yearsThere's no
transmission.desktop
intransmission
's source file. Check if you meanttransmission-gtk.desktop
. -
Quinn Culver almost 11 yearsThis doesn't seem to have worked. Still, even when I try your test from the terminal (to download Ubuntu), it opens a new Chrome window.
-
Quinn Culver almost 11 yearsI tried this. It didn't seem to work.
-
Quinn Culver almost 11 years@Braiam Yes, I tried with and without the
-gtk
. -
Braiam almost 11 years@QuinnCulver What's the output of
gconftool-2 -g /desktop/gnome/url-handlers/magnet/command
? -
Braiam almost 11 years@QuinnCulver and
gconftool-2 -g /desktop/gnome/url-handlers/magnet/enabled
? Try logging out to force the values to be updated. -
Quinn Culver almost 11 yearsThe output is:
true
. I'd rebooted last time I tried your suggested commands. I'll try again; this time I'll only log out. -
Braiam almost 11 years@QuinnCulver I updated my responce with yet another solution.
-
Akisame over 10 yearsYou actually have to add the bittorrent entry to the xdg-open list to make this work with chrome as far as I know. Also bittorrent is a name for the system so almost all bittorrent clients have the word bittorrent in it's name.
-
zrajm about 9 yearsThat was not exactly the solution I was looking for (I don't like having to patch my OS stuff, even if it's just a silly wrapper script). But it worked perfectly. (I'm on Ubuntu 14.04.2 LTS with Chromium set as my default browser.)
-
Umar about 9 yearscan i copy and repaste the whole thing again on lubuntu 14.04 lts.
-
tpv about 9 years@john : I'm on 14.04 too, using the same script, it should work :) (but please make a backup just in case)
-
Gabriel Felvinczi over 8 yearsthe gist link is a 404
-
tpv over 8 years@m0sa : should be fixed now