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

Quinn Culver
  • 93
  • 1
  • 1
  • 12
  • This should help [How to tell chrome what to do with a magnet link][1] [1]: http://askubuntu.com/questions/108925/how-to-tell-chrome-what-to-do-with-a-magnet-link – BiggJJ Jun 22 '13 at 21:07
  • Note: I'm using Lubuntu 13.04. – Quinn Culver Jul 13 '13 at 15:52
  • Note: Firefox correctly handles magnet links. – Quinn Culver Jul 13 '13 at 16:14
  • @BiggJJ I tried following Chan-Ho Suh's solution there, but to no avail. – Quinn Culver Jul 14 '13 at 02: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. – Radu Rădeanu Jul 14 '13 at 08:59
  • You are trying to open a `magnet://` link, or downloading a proper `.torrent` file? – Braiam Jul 19 '13 at 20:20
  • @Braiam A magnet. – Quinn Culver Jul 21 '13 at 14:54
  • just press right click in magnet link and copy it after that go to transsmion program and but it on it – Nihilist Freedom Jul 21 '13 at 14:59
  • @RaduRădeanu Version 28.0.1500.71 – Quinn Culver Jul 21 '13 at 16:07
  • @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. – Quinn Culver Jul 21 '13 at 16:09
  • Can you post `cat /usr/share/app-install/desktop/chrome.desktop | grep MimeType` and `cat /usr/share/application/chrome.desktop | grep MimeType`? – Braiam Jul 21 '13 at 17:46
  • `cat: /usr/share/app-install/desktop/chrome.desktop: No such file or directory` and `cat: /usr/share/application/chrome.desktop: No such file or directory` – Quinn Culver Jul 22 '13 at 06:09
  • Ok, lets try to start clean, uninstall all transmission packages `apt-get purge transmission*` and install just `transmission-gtk`. I've tested again and I just don't see where things went wire. – Braiam Jul 22 '13 at 12:55
  • @Braiam I re-installed transmission (per your suggestion) but am still having the same problem. – Quinn Culver Jul 22 '13 at 17:50
  • This 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. – zrajm May 31 '15 at 13:50

6 Answers6

13

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.

mniess
  • 10,369
  • 7
  • 49
  • 77
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.

tpv
  • 358
  • 2
  • 4
  • 11
  • 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 '15 at 13:46
  • can i copy and repaste the whole thing again on lubuntu 14.04 lts. – Umar Jun 03 '15 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 04 '15 at 14:25
  • the gist link is a 404 – m0sa Dec 05 '15 at 12:42
  • @m0sa : should be fixed now – tpv Dec 06 '15 at 05: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.

Braiam
  • 66,947
  • 30
  • 177
  • 264
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

totti
  • 6,768
  • 4
  • 38
  • 48
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..

  • 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 '13 at 07: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

Manish
  • 9
  • 1