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: rows:
selector: table[border="1"][cellpadding=5] > tbody > tr:has(a[href^="details.php?id="]) selector: table[border="1"][cellpadding=5] > tbody > tr:has(a[href^="details.php?id="])
fields: fields:
is_polish: # Workaround: https://github.com/Jackett/Jackett/issues/8068#issuecomment-610222414
text: ""
is_polish: is_polish:
optional: true optional: true
selector: img[src*="cat_pl"] selector: img[src*="cat_pl"]

View File

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

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers
set => base.configData = value; 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 = private static readonly string[] _SupportedLogicFunctions =
{ {
@ -1587,8 +1587,11 @@ namespace Jackett.Common.Indexers
{ {
if (!variables.ContainsKey(variablesKey)) if (!variables.ContainsKey(variablesKey))
variables[variablesKey] = null; 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; 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)); 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));
} }
} }