Skip to content

Commit d2e6ecc

Browse files
committed
Use trackers from magnet link when calling get_metainfo
1 parent 7127839 commit d2e6ecc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tribler/core/libtorrent/torrentdef.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ def load_only_sha1(infohash: bytes, name: str, url: str) -> TorrentDef:
325325
"""
326326
This loads a TorrentDef with only the SHA-1, without resolving it from the given URI.
327327
"""
328-
atp = lt.add_torrent_params()
328+
# Magnet links need to be parsed to avoid losing the trackers.
329+
atp = lt.parse_magnet_uri(url) if url.startswith("magnet") else lt.add_torrent_params()
329330
atp.info_hash = lt.sha1_hash(infohash)
330331
atp.name = name
331332
atp.url = url

0 commit comments

Comments
 (0)