Jackett: [Feature Request] Direct Magnet Link provided for copy in Manual Search

Created on 12 Aug 2019  路  9Comments  路  Source: Jackett/Jackett

I have Sonarr and transmission(web) chained together with Jackett. I find it much less annoying to skip going to torrent sites directly (ugh ads) and just using manual search for the occasional one-off searches I do that aren't tv for Sonarr. It would be nice if for the search results there was another column that provided just the magnet link. Even better if it was a button that copied it to the clipboard. The download link provided by Jackett is a link to the API, but transmission-web doesn't support torznab links. Currently I'm hitting F12, going to the network tab, clicking on the download link, then copying the magnet link from there. This should be easy, as one of my indexers doesn't support torznab, and the magnet link is available then.

Confirmed

Most helpful comment

Right I tried with 1337, the behaviour is wrong. In case of magnet, you should have at least 3 icons.

  1. Download locally icon (creates a .magnet file with the link in it in the local download folder)
  2. magnet icon (right click and copy paste)
  3. blackhole icon (creates a .magnet file with the link in it in the blackhole specified)

I can look into it, but as you guys, I am just a user and not a dev of Jackett.
Can't promise anything.

All 9 comments

When a magnet link is available, you should have a magnet icon.
Screenshot 2019-08-24 at 12 53 29

Download locally translates jackett api to an magnet link.
This opens my local torrent program on my machine. But how do I copy the actual magnet link, so I can paste it in a remote torrent machine, eg deluge?
I think thats what @yaroto98 meant

An example of that is 1337x,. When using 1337x, I dont get a direct magnet link. Only a jacketlink/api.

This is exactly what I meant.

Right I tried with 1337, the behaviour is wrong. In case of magnet, you should have at least 3 icons.

  1. Download locally icon (creates a .magnet file with the link in it in the local download folder)
  2. magnet icon (right click and copy paste)
  3. blackhole icon (creates a .magnet file with the link in it in the blackhole specified)

I can look into it, but as you guys, I am just a user and not a dev of Jackett.
Can't promise anything.

a bit of background info for you.
when jackett processes the html results of a website, then, if that search result has the .torrent download link and/or the magnet in the results, jackett can provide those links directly.
in the case of magnets, it will display the U icon and for .torrents you get the download icon.

if however, the site only provides links via each torrent's details page, (or provides in the results page links that require the details page of the torrent to be fetched first), then jackett does not know what kind of link it is, or even if there are multiple links, being .torrent, magnet or both.
You may ask why Jackett does not do a prefetch to find out, and the answer would be that this would add up to 100 potential network requests, one for each of the torrents in the results page, which would most likely get your ip address blacklisted as a possible DDoS attacker.

so in the case of the download links being in the details page, jackett just puts up the download icon, and the path is not resolved until you actually click the link icon. Because there is just the one download icon on the jackett results page to signified a indirect download link, only one link can be access from the details page this way.
For some sites which have multiple links on the details page, the indexer can have a config setting to identify which link is preferred, assuming some one has set up the indexer with this option.

I am also not a dev of jackett, so do not ask me any deeper questions, or request for C# code fixes, its beyond my skills.

This is not a perfect solution but if you are struggling to download using the links provided for indexers such as '1337x'

You can use the following to pull the magnet link from the URL headers

curl -si '$torrent_url' | grep -oP 'Location: \K.*'

My solution in Perl to retrieve torrent information from the tornznab api

        my $dom = XML::LibXML->load_xml(location => $url);

        for my $item ($dom->findnodes('//item')) {
            my $title = $item->findvalue('./title');
            my $size = int($item->findvalue('./size')) / 1000000;
            my $torrent_url = $item->findvalue('./link');
            my $seeds;
            my $magnet;


            for ($item->findnodes('./torznab:attr')) {
                $seeds  = $_->{value} if $_->{name} eq "seeders";
            }

            # Pull headers from link and grep magnet URL
            $magnet = `curl -si '$torrent_url' | grep -oP 'Location: \\K.*'`; # Extra backslash as an escape

            push @torrents, {
                'title'  => $title,
                'size'   => $size,
                'seeds'  => $seeds,
                'magnet' => $magnet
                };
        }

The above is what I do, use curl to grab the final redirect Location header. But since that's all this button does, why not just serve that in the first place?

(And why can't Deluge be smart enough to follow 302's either? Grrr)

I guess what the OP suggested is to use a icon to fast copy a magnet link in the results list of Jackett.
Actually, the 'U' icon opens the magnet link (browser supporting it or not).
In my case, in safari, it opens a new tab with an error showing the link I then copy.

This is definitely something I will use (a fast magnet link copy icon). It is on my todo list of things to add to Jackett, but I'm more focused on my PhD right now.. ;)

Edit:
In the case I find the time to do it, what would be the best icon to use in that case?
And more generally, do we want this feature? (it adds an icon for magnet results..)
Another idea would be to keep the same icon, but adding a Jackett option where clicking on a magnet U copy the link instead of opening it.

Was this page helpful?
0 / 5 - 0 ratings