Fixed: Unset variable in CardigannIndexer if it's missing in the row (#9305)

This commit is contained in:
ta264 2020-08-12 07:01:59 +01:00 committed by GitHub
parent 5a856b2777
commit 37a9d6b393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 20 deletions

View File

@ -79,8 +79,6 @@ search:
rows:
selector: table[border="1"][cellpadding=5] > tbody > tr:has(a[href^="details.php?id="])
fields:
is_polish: # Workaround: https://github.com/Jackett/Jackett/issues/8068#issuecomment-610222414
text: ""
is_polish:
optional: true
selector: img[src*="cat_pl"]

View File

@ -61,8 +61,6 @@ search:
filters:
- name: querystring
args: cat
extras:
text: ""
extras:
optional: true
selector: td.titulo a[class]

View File

@ -118,21 +118,15 @@ search:
selector: td:nth-child(13)
leechers:
selector: td:nth-child(14)
subs:
text: ""
subs:
selector: span:contains("Subs:")
optional: true
genre:
text: ""
genre:
selector: td:nth-child(5)
optional: true
filters:
- name: prepend
args: "Genre: "
mom:
text: ""
mom:
selector: img[title^="CURRENT"]
attribute: title

View File

@ -42,24 +42,18 @@ search:
selector: img
attribute: src
optional: true
actress:
text: ""
actress:
selector: a[href^="/actress/"]
optional: true
filters:
- name: prepend
args: "Actress: "
tags:
text: ""
tags:
selector: div.tags
optional: true
filters:
- name: prepend
args: "Tags: "
descr:
text: ""
descr:
selector: p.level
optional: true

View File

@ -136,8 +136,6 @@ search:
optional: true
selector: a[href*="imdb.com/title/tt"]
attribute: href
description:
text: ""
description:
optional: true
selector: img[src="pic/pl.jpg"]

View File

@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers
set => base.configData = value;
}
protected readonly string[] OptionalFileds = new string[] { "imdb", "rageid", "tvdbid", "banner" };
protected readonly string[] OptionalFields = new string[] { "imdb", "rageid", "tvdbid", "banner" };
private static readonly string[] _SupportedLogicFunctions =
{
@ -1587,8 +1587,11 @@ namespace Jackett.Common.Indexers
{
if (!variables.ContainsKey(variablesKey))
variables[variablesKey] = null;
if (OptionalFileds.Contains(Field.Key) || FieldModifiers.Contains("optional") || Field.Value.Optional)
if (OptionalFields.Contains(Field.Key) || FieldModifiers.Contains("optional") || Field.Value.Optional)
{
variables[variablesKey] = null;
continue;
}
throw new Exception(string.Format("Error while parsing field={0}, selector={1}, value={2}: {3}", Field.Key, Field.Value.Selector, (value == null ? "<null>" : value), ex.Message));
}
}