12

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

15
  • This should help [How to tell chrome what to do with a magnet link][1] [1]: askubuntu.com/questions/108925/…
    – BiggJJ
    Jun 22, 2013 at 21:07
  • Note: I'm using Lubuntu 13.04. Jul 13, 2013 at 15:52
  • Note: Firefox correctly handles magnet links. Jul 13, 2013 at 16:14
  • @BiggJJ I tried following Chan-Ho Suh's solution there, but to no avail. Jul 14, 2013 at 2:44
  • What 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. Jul 14, 2013 at 8:59

6 Answers 6

13
+25

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.

3
  • I 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). Jul 21, 2013 at 14:50
  • There's no transmission.desktop in transmission's source file. Check if you meant transmission-gtk.desktop.
    – Braiam
    Jul 21, 2013 at 15:26
  • @Braiam Yes, I tried with and without the -gtk. Jul 21, 2013 at 16:12
8

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.

5
  • That 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.)
    – zrajm
    May 31, 2015 at 13:46
  • can i copy and repaste the whole thing again on lubuntu 14.04 lts.
    – Umar
    Jun 3, 2015 at 14:18
  • @john : I'm on 14.04 too, using the same script, it should work :) (but please make a backup just in case)
    – tpv
    Jun 4, 2015 at 14:25
  • the gist link is a 404
    – m0sa
    Dec 5, 2015 at 12:42
  • @m0sa : should be fixed now
    – tpv
    Dec 6, 2015 at 5:23
4

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.

6
  • This 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. Jul 21, 2013 at 16:06
  • @QuinnCulver What's the output of gconftool-2 -g /desktop/gnome/url-handlers/magnet/command?
    – Braiam
    Jul 21, 2013 at 16:50
  • The output is: /usr/bin/transmission-gtk %s Jul 21, 2013 at 17:00
  • @QuinnCulver and gconftool-2 -g /desktop/gnome/url-handlers/magnet/enabled? Try logging out to force the values to be updated.
    – Braiam
    Jul 21, 2013 at 17:10
  • The output is: true. I'd rebooted last time I tried your suggested commands. I'll try again; this time I'll only log out. Jul 21, 2013 at 17:23
0

unable to contact http ://localhost:9091/transmission/rpc

no response

To fix this

  1. Install transmission-remote
    sudo apt-get install transmission-remote

  2. Start transmission (transmission-gtk) before adding .torrent files

  3. Enable web client, set port to 9091 (From edit -> preference -> web ) if necessary

3
0

if ur using bittorrent go to preferences-general-click on the tab that says associate with torrents..now it will work when you try magnet link..

1
  • You 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.
    – Akisame
    Dec 12, 2013 at 7:07
0

If you want to Open Piratebay magnet link with Transmission Client then on Magnet Link 1 Right Click 2 Copy Link Location Open Transmission File> Open URL

It's Done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .