Fixed: MoreThanTV indexer from browse page layout changes (#922)

pull/931/head
missingfile 3 years ago committed by Qstick
parent a5c7c6cbcb
commit d440bc079f

@ -150,14 +150,14 @@ public class MoreThanTVRequestGenerator : IIndexerRequestGenerator
qc.Add("filter_cat[2]", "1"); // SD Movies qc.Add("filter_cat[2]", "1"); // SD Movies
break; break;
case TvSearchCriteria: case TvSearchCriteria:
qc.Add("filter_cat[3]", "1"); // HD EPISODE qc.Add("filter_cat[3]", "1"); // HD Episode
qc.Add("filter_cat[4]", "1"); // SD Episode qc.Add("filter_cat[4]", "1"); // SD Episode
qc.Add("filter_cat[5]", "1"); // HD Season qc.Add("filter_cat[5]", "1"); // HD Season
qc.Add("filter_cat[6]", "1"); // SD Season qc.Add("filter_cat[6]", "1"); // SD Season
break; break;
} }
return $"{Settings.BaseUrl}torrents.php?{qc.GetQueryString()}"; return $"{Settings.BaseUrl}torrents/browse?{qc.GetQueryString()}";
} }
private string GetSearchString(string input) private string GetSearchString(string input)
@ -188,28 +188,25 @@ public class MoreThanTVParser : IParseIndexerResponse
foreach (var torrent in torrents) foreach (var torrent in torrents)
{ {
// Parse required data // Parse required data
var torrentGroup = torrent.QuerySelectorAll("table a[href^=\"/torrents.php?action=download\"]"); var downloadAnchor = torrent.QuerySelector("span a[href^=\"/torrents.php?action=download\"]");
foreach (var downloadAnchor in torrentGroup) var title = downloadAnchor.ParentElement.ParentElement.ParentElement.QuerySelector("a[class=\"overlay_torrent\"]").TextContent.Trim();
{ title = CleanUpTitle(title);
var title = downloadAnchor.ParentElement.ParentElement.ParentElement.TextContent.Trim();
title = CleanUpTitle(title);
var category = torrent.QuerySelector(".cats_col div").GetAttribute("title");
// default to Other var category = torrent.QuerySelector(".cats_col div").GetAttribute("title");
var indexerCategory = NewznabStandardCategory.Other;
if (movies.Any(category.Contains)) // default to Other
{ var indexerCategory = NewznabStandardCategory.Other;
indexerCategory = NewznabStandardCategory.Movies;
}
else if (tv.Any(category.Contains))
{
indexerCategory = NewznabStandardCategory.TV;
}
releases.Add(GetReleaseInfo(torrent, downloadAnchor, title, indexerCategory)); if (movies.Any(category.Contains))
{
indexerCategory = NewznabStandardCategory.Movies;
} }
else if (tv.Any(category.Contains))
{
indexerCategory = NewznabStandardCategory.TV;
}
releases.Add(GetReleaseInfo(torrent, downloadAnchor, title, indexerCategory));
} }
return releases; return releases;
@ -231,7 +228,7 @@ public class MoreThanTVParser : IParseIndexerResponse
private ReleaseInfo GetReleaseInfo(IElement row, IElement downloadAnchor, string title, IndexerCategory category) private ReleaseInfo GetReleaseInfo(IElement row, IElement downloadAnchor, string title, IndexerCategory category)
{ {
// count from bottom // count from bottom
const int FILES_COL = 8; const int FILES_COL = 7;
/*const int COMMENTS_COL = 7;*/ /*const int COMMENTS_COL = 7;*/
const int DATE_COL = 6; const int DATE_COL = 6;
const int FILESIZE_COL = 5; const int FILESIZE_COL = 5;

Loading…
Cancel
Save