Problem with magnet links in Ubuntu Natty

General support for problems installing or using Deluge
666
New User
New User
Posts: 6
Joined: Fri Oct 31, 2008 10:41 am

Problem with magnet links in Ubuntu Natty

Postby 666 » Mon May 09, 2011 6:38 pm

Hello i have a problem in Ubuntu Natty associating magnet links with Deluge. If i associate magnet links with some other client it works well, but when i try with Deluge they keep opening with the previous program i had associated.
In gconf-editor i saw that when i associate magnet links with the (others - associate magnet links with deluge) menu, the command it uses is deluge '%s', i tried changing it to deluge-gtk '%s' and doesn't work either.

If i type in a console deluge + some magnet link it opens with deluge without problem.

Someone have any idea in how to fix the problem?

I posted this problem in support but i think this comes here.

Cas
Top Bloke
Top Bloke
Posts: 3641
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Problem with magnet links in Ubuntu Natty

Postby Cas » Thu May 12, 2011 11:52 pm

Are you sure its not a problem with xdg-open as reported here: http://ubuntuforums.org/showthread.php?t=1747876

I have tried it with Firefox 4 magnet handler and works ok.

666
New User
New User
Posts: 6
Joined: Fri Oct 31, 2008 10:41 am

Re: Problem with magnet links in Ubuntu Natty

Postby 666 » Sat May 28, 2011 12:04 pm

I don't know what the problem is, but it only happens with Deluge.

jodon

Re: Problem with magnet links in Ubuntu Natty

Postby jodon » Sat May 28, 2011 4:13 pm

<re-post of my reply from the support forum>

Currently Ubuntu has a bug in the Deluge packaging.

You already found the keys in gconf-editor that are set to associate deluge with magnet links, but those keys only affect the behaviour of xdg-open.
As of Natty, it appears that the file-open functionality is instead handled by gvfs-open. To test, You can invoke gvfs-open directly on the command line and give it a magnet link as an argument.

gvfs-open doesn't use the gconf stuff, instead it examines the .desktop files bundled with each application to determine what file types can be handled.

The /usr/share/applications/deluge.desktop file has two separate problems in it, both of which must be fixed for deluge to start handling magnet links from your web browser.

The current "official" version of the file:

Code: Select all

Version=1.0
Name=Deluge BitTorrent Client
GenericName=Bittorrent Client
Comment=Transfer files using the Bittorrent protocol
Exec=deluge-gtk
Icon=deluge
Terminal=false
Type=Application
Categories=Network;
StartupNotify=true
MimeType=application/x-bittorrent;

First problem:

Code: Select all

Exec=deluge-gtk

This line should have "%U" added to the end, this string gets replaced with the url/filename for deluge to open when invoked.

Second problem:

Code: Select all

MimeType=application/x-bittorrent;

This does not specify that deluge is capable of handling magnet links.

Corrected version:

Code: Select all

Version=1.0
Name=Deluge BitTorrent Client
GenericName=Bittorrent Client
Comment=Transfer files using the Bittorrent protocol
Exec=deluge-gtk %U
Icon=deluge
Terminal=false
Type=Application
Categories=Network;
StartupNotify=true
MimeType=application/x-bittorrent;x-scheme-handler/magnet;


If you are changing this by hand, then you need to run "update-desktop-database" after saving the corrected version of the file.

There is no bug for this in launchpad currently, I tried to create one this morning but couldn't figure out how. :oops:

Cas
Top Bloke
Top Bloke
Posts: 3641
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Problem with magnet links in Ubuntu Natty

Postby Cas » Sat May 28, 2011 4:39 pm

We have actually updated the Desktop file for 1.3.2 and will be in PPA soon.

deluge.desktop

ChaosR

Re: Problem with magnet links in Ubuntu Natty

Postby ChaosR » Wed Sep 28, 2011 7:34 pm

For me, adding the following line to ~/.local/share/applications/mimeapps.list was also needed to get deluge running magnet links, instead of transmission:

Code: Select all

x-scheme-handler/magnet=deluge.desktop;


Return to “Support”

Who is online

Users browsing this forum: No registered users and 4 guests