Torznab results are missing the link tag
- [v] I have checked the existing issues to avoid duplicates
- [v] I have redacted any info hashes and content metadata from any logs or screenshots attached to this issue
Describe the bug
Following the example on this page with regards to the torznab format:
There is a element inside of the
To Reproduce
Steps to reproduce the behavior:
Query bitmagnet via the torznab api. For example:
<url to torznab api>?t=music&q=wuthering heights
Expected behavior
Link element to be available inside of each item element.
Environment Information (Required)
- Bitmagnet version: 0.9.5
- OS and version: Alpine Linux / Docker v25
Additional context
When connecting Bitmagnet as search engine for headphones, headphones fails on the missing link element.
Technically speaking, this is an issue with Headphones; the Torznab spec (though flawed) doesn't list link as required, nor is it required in the RSS spec.
That being said, I don't see why this couldn't be added to Bitmagnet for compatibility sake.
Would be great if it could be added. That way headphones can be used as well.
Thanks for the reply!
@askiiart @Stitch10925 I've been searching for definition on link element and cannot find it. Taking an example from what bitmagnet currently produces. Should link element be the url attribute of enclosure element? Which is same as magneturl extended attribute
I'm currently doing maintenance / enhancements of torznab bitmagent interface. Happy to include this.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed">
<channel>
<title>bitmagnet</title>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate>
<response xmlns="http://www.newznab.com/DTD/2010/feeds/attributes/"></response>
<item>
<title>redacted (2010) Flac</title>
<guid>c13fe30fd524c0bb99433512d419cd8bca04a689</guid>
<pubDate>Sun, 19 Jan 2025 11:06:28 +0000</pubDate>
<category>music</category>
<size>579189180</size>
<comments>http://172.17.0.1:3336/webui/torrents/permalink/c13fe30fd524c0bb99433512d419cd8bca04a689</comments>
<enclosure url="magnet:?xt=urn:btih:c13fe30fd524c0bb99433512d419cd8bca04a689&dn=redacted+-+redacted+%282010%29+Flac&xl=579189180" length="579189180" type="application/x-bittorrent;x-scheme-handler/magnet"></enclosure>
<torznab:attr name="infohash" value="c13fe30fd524c0bb99433512d419cd8bca04a689"></torznab:attr>
<torznab:attr name="magneturl" value="magnet:?xt=urn:btih:c13fe30fd524c0bb99433512d419cd8bca04a689&dn=redacted+-+redacted+%282010%29+Flac&xl=579189180"></torznab:attr>
<torznab:attr name="category" value="3000"></torznab:attr>
<torznab:attr name="size" value="579189180"></torznab:attr>
<torznab:attr name="publishdate" value="Sun, 19 Jan 2025 11:06:28 +0000"></torznab:attr>
<torznab:attr name="seeders" value="25"></torznab:attr>
<torznab:attr name="leechers" value="7"></torznab:attr>
</item>
</channel>
</rss>
I think link can be a link to its web UI thing, and if not, then a link to the torrent file or the magnet URI (i.e. the same as the url attribute of the enclosure element); not 100% sure about that first bit, but I'm 100% sure about the torrent file and magnet URI.
As for Newznab, again I'm not entirely sure if the web UI thing is okay, but I can confirm that link being the same as the url in the enclosure element works right, as seen here.
Though after a tad more thought, given Headphones requires link, my guess would be that link should be the torrent file or magnet URI.
Thanks - I don't have a way to test really. If I provide you with a branch with change can you build and test? When you refer to headphones do you mean this: https://github.com/rembo10/headphones?tab=readme-ov-file ? At quick glance there is no docker image for it...
@rraymondgh Thanks for adding this in!
The docker image is this one: https://hub.docker.com/r/linuxserver/headphones/
I agree that link should be a web UI permalink rather than a magnet link. However this element is optional, so it's definitely a Headphones bug. We'll only be able to construct a permalink if we know the correct base URL to use (and not at all for < v0.10.x).
OK a few things.
- Make sure you are using newest version of headphones. I did this by:
# make sure you have a recent python3 and sqlite installed. I used a nix flake for this
gh repo clone rembo10/headphones
cd headphones
mkdir ../datadir
python3 Headphones.py --datadir=../datadir/ --host=0.0.0.0
- this version is > 50 commits ahead of docker image on linuxserver.io
- last commit was b6908500190f1ff1228fc4a91d08dc7a06332aad torznab enclosure url on Dec 7th 2024
- after working through how to configure this app with bitmagnet and qbittorrent I was able to setup an artist, select an album and trigger a search of bitmagnet than had 1 result that based name, size and seeders checks. It send this to qbitorrent. Before sending to qbittorrent it did produce this error
26-Jan-2025 20:05:35 - ERROR :: ('CP Server Thread-2',) : Request raised exception: No connection adapters were found for 'magnet:?xt=urn:btih:0669<<retract>>'
There is no issue for bitmagnet