mirror of
https://github.com/Jackett/Jackett
synced 2024-12-29 03:06:49 +00:00
TorrentNetwork: improve passkey handling
This commit is contained in:
parent
bc4bbbb7fb
commit
d49cb02d2f
1 changed files with 7 additions and 2 deletions
|
@ -145,9 +145,11 @@ namespace Jackett.Indexers
|
||||||
APIHeaders["Authorization"] = token;
|
APIHeaders["Authorization"] = token;
|
||||||
|
|
||||||
var curuser = await SendAPIRequest("curuser", null);
|
var curuser = await SendAPIRequest("curuser", null);
|
||||||
|
if (curuser.passkey.IsNullOrEmptyOrWhitespace())
|
||||||
|
throw new ExceptionWithConfigData("got empty passkey: " + curuser.ToString(), configData);
|
||||||
|
passkey = curuser.passkey;
|
||||||
var passkeyItem = (HiddenItem)configData.GetDynamic("passkey");
|
var passkeyItem = (HiddenItem)configData.GetDynamic("passkey");
|
||||||
passkeyItem.Value = curuser.passkey;
|
passkeyItem.Value = passkey;
|
||||||
|
|
||||||
var tokenItem = (HiddenItem)configData.GetDynamic("token");
|
var tokenItem = (HiddenItem)configData.GetDynamic("token");
|
||||||
tokenItem.Value = token;
|
tokenItem.Value = token;
|
||||||
|
@ -181,6 +183,9 @@ namespace Jackett.Indexers
|
||||||
|
|
||||||
searchUrl += "?" + queryCollection.GetQueryString();
|
searchUrl += "?" + queryCollection.GetQueryString();
|
||||||
|
|
||||||
|
if (passkey.IsNullOrEmptyOrWhitespace())
|
||||||
|
await ApplyConfiguration(null);
|
||||||
|
|
||||||
var result = await SendAPIRequest(searchUrl, null);
|
var result = await SendAPIRequest(searchUrl, null);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue