From a00cac6ad320734ed7d6b86d3491ccfe378f38e8 Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Tue, 24 Aug 2021 09:23:01 +1200 Subject: [PATCH] internetarchive: config option no_magnet. resolves #12209 --- src/Jackett.Common/Indexers/InternetArchive.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Common/Indexers/InternetArchive.cs b/src/Jackett.Common/Indexers/InternetArchive.cs index 552630be0..c5185eacb 100644 --- a/src/Jackett.Common/Indexers/InternetArchive.cs +++ b/src/Jackett.Common/Indexers/InternetArchive.cs @@ -29,6 +29,7 @@ namespace Jackett.Common.Indexers private string _sort; private string _order; private bool _titleOnly; + private bool _noMagnet; private ConfigurationData ConfigData => configData; @@ -88,6 +89,9 @@ namespace Jackett.Common.Indexers var titleOnly = new BoolConfigurationItem("Search only in title") { Value = true }; configData.AddDynamic("titleOnly", titleOnly); + var noMagnet = new BoolConfigurationItem("Download using .torrent only. No Magnets.") { Value = false }; + configData.AddDynamic("noMagnet", noMagnet); + AddCategoryMapping("audio", TorznabCatType.Audio); AddCategoryMapping("etree", TorznabCatType.Audio); AddCategoryMapping("movies", TorznabCatType.Movies); @@ -124,6 +128,9 @@ namespace Jackett.Common.Indexers var titleOnly = (BoolConfigurationItem)configData.GetDynamic("titleOnly"); _titleOnly = titleOnly != null && titleOnly.Value; + + var noMagnet = (BoolConfigurationItem)configData.GetDynamic("noMagnet"); + _noMagnet = noMagnet != null && noMagnet.Value; } protected override async Task> PerformQuery(TorznabQuery query) @@ -199,7 +206,7 @@ namespace Jackett.Common.Indexers Peers = 2, Grabs = GetFieldAs("downloads", torrent), Link = link, - InfoHash = btih, // magnet link is auto generated from infohash + InfoHash = _noMagnet? null : btih, // magnet link is auto generated from infohash DownloadVolumeFactor = 0, UploadVolumeFactor = 1 };