MejorTorrent: handle 4K and 3D. resolves #3384 (#5568)

This indexer was not able to distinguish whether a film is 3D or 4K, which made it totally unusable.

After a lot of fighting with Visual Studio to do tests compiling Jackett, I got the indexer to differentiate 3D and 4K movies.

Example screenshot:
https://imgur.com/cVp2Klc
This commit is contained in:
Yllelder Bamir 2019-06-30 06:32:54 +02:00 committed by garfield69
parent 33c6f753a1
commit eeb0e9b982
1 changed files with 29 additions and 6 deletions

View File

@ -662,6 +662,7 @@ namespace Jackett.Common.Indexers
release.IsMovie = true;
var selectors = html.QuerySelectorAll("b");
var titleSelector = html.QuerySelector("span>b");
var titleSelector3do4k = html.QuerySelector("span:nth-child(4) > b:nth-child(1)");
try
{
var title = titleSelector.TextContent;
@ -712,19 +713,41 @@ namespace Jackett.Common.Indexers
try
{
var title = titleSelector.TextContent;
if (title.Contains("(") && title.Contains(")") && title.Contains("4k"))
if (title.Contains("(") && title.Contains(")") && title.Contains("3D"))
{
release.CategoryText = "2160p";
release.CategoryText = "3D";
}
}
catch { }
} catch { }
try
{
var title = titleSelector.TextContent;
if (title.Contains("(") && title.Contains(")") && title.Contains("4K"))
{
release.CategoryText = "4K";
}
} catch { }
try
{
var title = titleSelector3do4k.TextContent;
if (title.Contains("[") && title.Contains("]") && title.Contains("3D"))
{
release.CategoryText = "3D";
}
} catch { }
try
{
var title = titleSelector3do4k.TextContent;
if (title.Contains("[") && title.Contains("]") && title.Contains("4K"))
{
release.CategoryText = "4K";
}
} catch { }
try
{
var link = html.QuerySelector("a[href*=\"sec=descargas\"]").GetAttribute("href");
release.Link = new Uri(WebUri, link);
release.Guid = release.Link;
}
catch { }
} catch { }
return release;
}
}