Help with ktorrent plugin: Magnet Generator

ktorrent comes with several pre-built plugins; one of which is Magnet Generator. The description says: Generates Magnet Links. That’s it. There’s no resource on how to use it or how to access it from GUI.

I browsed KDE Forums and all I could find was a thread discussing the introduction of this plugin.
Plans for magnet URI generator

I would like any help in figuring out how to use this plugin.

Operating System: Manjaro Linux 21.2.0 Qonos
Ktorrent Version: 21.12.0
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.10.84-1-MANJARO (64-bit)

This is absolutely not what I am having problem with. I know what magnet links are and how to use them with torrent clients. But thanks for the reply.

The issue I am having is with the particular plugin that ships with ktorrent. It supposed to create (extract) magnet links from the torrents in the queue.

After trying to read and understand the code for the plugin, I think it supposed to create an option in the context menu that appears when right clicking a torrent in the queue.

I don’t know why it won’t show up in the menu or I read the code wrong or its simply a bug or outdated code. In the dicussion at the KDE Forum thread the Moderator George suggested to the OP to reuse UI code form another plugin called Download Reorder. And when I tried using it. That too wasn’t working. It supposed to create, I think, a context menu entry to reordering download order of a multi file torrent. But the functionality is already built in ktorrent.

I am pretty sure it’s just called “Copy Torrent URL”. Under “Advanced” in the right click menu. Otherwise I am actually having trouble getting this program to download torrents in general to test it out myself.
qbittorrent seems to have the exact same functionality, and it’s right click > copy > magnet link to get the link from it. So this really isn’t a program specific function

They are not the same. Yes, while this works for torrents that were added as magnets or using hashes, for torrents that were added using torrent files it just copies the fileURI (file://…) with path the file was added from.

I know, I migrated from qbittorrent because it would just run my CPU at 100% all the time. None of the suggestions on the qb forums helped. Then I tried Deluge. It was a letdown in almost every way. Then I found ktorrent. Its been excellent so far. Plus it being a KDE software it integrates nicely.

dont know whether this is of any help, so this is how i create mine. get/copy the torrent hash from details.

your magnet-link would be;

magnet:?xt=urn:btih:<torrent-hash>

Yes, unfortunately thats what I had to do when transferring torrents from Deluge to ktorrent. I had to copy hashes one by one. Because Deluge just doesn’t have export function of any kind.

I figured it out.

It had to do with ktorrent_magnetgeneratorui.rc as discussed in this reply to OP by the Moderator at KDE Forums. I zerored in on that because the Moderator adviced the OP to reuse code from another plugin.

To cut the chase short, basically KDE applications like dolphin, ark, ktorrent and these plugins use kpartgui.dtd, and store the config-xml at /usr/share/kxmlgui5/{application-name}/{name}.rc

Well, I copied the above file to $HOME/.local/share/kxmlgui5/MagnetGeneratorPlugin/ directory, restarted ktorrent and the menu entry was now available in the context menu as its supposed to.

Now,
image

If this is a bug then steps to reproduce are:

  1. Install ktorrent
  2. Enable the Magnet Generator plugin
  3. Right click on any torrent.

Expected behaviour is the image above.

I tried reporting the bug to the ktorrent section at KDE Forums. But it needs me to create a KDE Identity for which it sent me an email but at the time of posting this I hadn’t received any.