Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Magnet links does not add trackers #8363

Open
teddyrogers opened this issue Dec 29, 2024 · 3 comments
Open

Adding Magnet links does not add trackers #8363

teddyrogers opened this issue Dec 29, 2024 · 3 comments

Comments

@teddyrogers
Copy link

Tribler 8.0.7, not sure if this is a bug or a feature request... after adding a magnet link with no trackers then clicking the, "Trackers", tab reveals only "[DHT]" and [PeX]", as expected.

Adding another Magnet link, this time with trackers included, does not add the trackers to the, "Trackers", tab list.

Please add new trackers to the Trackers list when importing Magnet (and Torrent files).

@SpudmanWP
Copy link

Same here, never noticed it before.

@qstokkink qstokkink added this to the 8.1.0 milestone Jan 6, 2025
@qstokkink
Copy link
Contributor

Nice find! Looking at our code history, I seems like we never supported this. It would definitely be good to have this.

[dev stuff below]

if scheme == "magnet":
logger.info("Magnet scheme detected")
params = lt.parse_magnet_uri(uri)
try:
# libtorrent 1.2.19
name, infohash = params["name"].encode(), params["info_hash"] # type: ignore[index] # (checker is 2.X)
except TypeError:
# libtorrent 2.0.9
name = params.name.encode()
infohash = unhexlify(str(params.info_hash))
logger.info("Name: %s. Infohash: %s", name, infohash)
if infohash in self.metainfo_cache:
logger.info("Metainfo found in cache")
tdef = TorrentDef.load_from_dict(self.metainfo_cache[infohash]["meta_info"])
else:
logger.info("Metainfo not found in cache")
tdef = TorrentDefNoMetainfo(infohash, name if name else b"Unknown name", url=uri)
return await self.start_download(tdef=tdef, config=config)

Right now, our code only uses the name (dn) and infohash (xt) to start a download. Adding support for trackers (tr) and selected files (so) should not be too difficult, and maybe even adding direct peers (x.pe) and web seeds (ws). Honestly, I'm not sure why we don't just pass the libtorrent params back into libtorrent to get all this "for free".

@teddyrogers
Copy link
Author

Honestly, I'm not sure why we don't just pass the libtorrent params back into libtorrent to get all this "for free".

It makes sense to me as the work is done for you. As Tribler uses libtorrent there are a lot of other parameters and features that could be taken advantage of and used for free in Tribler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants