sane-bt-search: fix BitMagnet torrent page URIs

This commit is contained in:
2025-07-07 21:05:36 +00:00
parent 604599b3b6
commit fbce38a47a

View File

@@ -253,6 +253,11 @@ class Torrent:
if tracker_uri: if tracker_uri:
# quirk: bakabt's post-login redirection fails if the slashes aren't just right # quirk: bakabt's post-login redirection fails if the slashes aren't just right
tracker_uri = tracker_uri.replace('https://bakabt.me//', 'https://bakabt.me/') tracker_uri = tracker_uri.replace('https://bakabt.me//', 'https://bakabt.me/')
# quirk: bitmagnet doesn't populate the torrent page, except as a link to the website homepage.
# TODO: fix and upstream this into either Jackett or Bitmagnet
if tracker_uri == 'http://10.0.1.6:3333/':
infohash = magnet.replace('magnet:?xt=urn:btih:', '').split('&')[0]
tracker_uri = f"https://bitmagnet.uninsane.org/webui/torrents/permalink/{infohash}"
if seeders is not None and pub_date is not None and title is not None and (magnet is not None or http_dl_uri is not None): if seeders is not None and pub_date is not None and title is not None and (magnet is not None or http_dl_uri is not None):
pub_date = parse_time(pub_date) pub_date = parse_time(pub_date)