From 218c4dfe3fd372de4e3ccda6f31c1881b1067186 Mon Sep 17 00:00:00 2001 From: seeyabye <36906720+seeyabye@users.noreply.github.com> Date: Thu, 1 Oct 2020 09:34:40 +0900 Subject: [PATCH] PassThePopcorn: fix downloading torrents (#9532) resolves #8927 --- src/Jackett.Common/Indexers/PassThePopcorn.cs | 7 ++++++- ...ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Jackett.Common/Indexers/PassThePopcorn.cs b/src/Jackett.Common/Indexers/PassThePopcorn.cs index af10d7701..43b085f16 100644 --- a/src/Jackett.Common/Indexers/PassThePopcorn.cs +++ b/src/Jackett.Common/Indexers/PassThePopcorn.cs @@ -22,6 +22,7 @@ namespace Jackett.Common.Indexers { private static string SearchUrl => "https://passthepopcorn.me/torrents.php"; private string AuthKey { get; set; } + private string PassKey { get; set; } // TODO: merge ConfigurationDataAPILoginWithUserAndPasskeyAndFilter class with with ConfigurationDataUserPasskey private new ConfigurationDataAPILoginWithUserAndPasskeyAndFilter configData @@ -123,6 +124,10 @@ namespace Jackett.Common.Indexers { //Iterate over the releases for each movie var jsResults = JObject.Parse(results.ContentString); + + AuthKey = (string)jsResults["AuthKey"]; + PassKey = (string)jsResults["PassKey"]; + foreach (var movie in jsResults["Movies"]) { var movieTitle = (string)movie["Title"]; @@ -142,7 +147,7 @@ namespace Jackett.Common.Indexers {"action", "download"}, {"id", torrentId}, {"authkey", AuthKey}, - {"torrent_pass", configData.Passkey.Value}, + {"torrent_pass", PassKey}, }; var free = !(torrent["FreeleechType"] is null); diff --git a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs index 257386561..2a79cb455 100644 --- a/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs +++ b/src/Jackett.Common/Models/IndexerConfig/ConfigurationDataAPILoginWithUserAndPasskeyAndFilter.cs @@ -2,7 +2,6 @@ namespace Jackett.Common.Models.IndexerConfig { public class ConfigurationDataAPILoginWithUserAndPasskeyAndFilter : ConfigurationData { - public StringItem Passkey { get; private set; } public DisplayItem KeyHint { get; private set; } public StringItem User { get; private set; } public StringItem Key { get; private set; } @@ -11,8 +10,6 @@ namespace Jackett.Common.Models.IndexerConfig public ConfigurationDataAPILoginWithUserAndPasskeyAndFilter(string FilterInstructions) { - Passkey = new StringItem { Name = "Passkey", Value = string.Empty }; - KeyHint = new DisplayItem("") { Name = "API Authentication"