Second part of correction #3997 (#4017)

- try/catch block for torrent parsing
Sonarr test button was failed because an invalid torrent.
This commit is contained in:
morpheus133
2018-10-17 08:09:33 +02:00
committed by garfield69
parent cae6d4ed73
commit c846eb4330

View File

@@ -129,9 +129,10 @@ namespace Jackett.Common.Indexers
// Check torrents only till we reach the query Limit // Check torrents only till we reach the query Limit
for(int i=0; (i<rows.Length && ((already_founded + releases.Count) < limit )); i++) for(int i=0; (i<rows.Length && ((already_founded + releases.Count) < limit )); i++)
{
try
{ {
CQ qRow = rows[i].Cq(); CQ qRow = rows[i].Cq();
var key = dom["link[rel=alternate]"].First().Attr("href").Split('=').Last(); var key = dom["link[rel=alternate]"].First().Attr("href").Split('=').Last();
release = new ReleaseInfo(); release = new ReleaseInfo();
@@ -212,7 +213,12 @@ namespace Jackett.Common.Indexers
releases.Add(release); releases.Add(release);
} }
} }
}
catch (FormatException ex)
{
logger.Error("Problem of parsing Torrent:" + rows[i].InnerHTML);
logger.Error("Exception was the following:" + ex);
}
} }
} }
catch (Exception ex) catch (Exception ex)