mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -90,7 +90,6 @@ namespace Jackett.Common.Indexers
|
|||||||
|
|
||||||
AddCategoryMapping(1, TorznabCatType.Movies);
|
AddCategoryMapping(1, TorznabCatType.Movies);
|
||||||
AddCategoryMapping(2, TorznabCatType.TV);
|
AddCategoryMapping(2, TorznabCatType.TV);
|
||||||
AddCategoryMapping(3, TorznabCatType.Other);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -157,7 +156,7 @@ namespace Jackett.Common.Indexers
|
|||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
string errorMessage = ParseErrorMessage(preRequest);
|
var errorMessage = ParseErrorMessage(preRequest);
|
||||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,11 +222,18 @@ namespace Jackett.Common.Indexers
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (query.Categories.Contains(TorznabCatType.Movies.ID))
|
if (query.Categories.Contains(TorznabCatType.Movies.ID))
|
||||||
qc.Add("filter_cat[1]", "1");
|
{
|
||||||
|
qc.Add("filter_cat[1]", "1"); // HD Movies
|
||||||
|
qc.Add("filter_cat[2]", "1"); // SD Movies
|
||||||
|
}
|
||||||
|
|
||||||
if (query.Categories.Contains(TorznabCatType.TV.ID))
|
if (query.Categories.Contains(TorznabCatType.TV.ID))
|
||||||
qc.Add("filter_cat[2]", "1");
|
{
|
||||||
if (query.Categories.Contains(TorznabCatType.Other.ID))
|
qc.Add("filter_cat[3]", "1"); // HD EPISODE
|
||||||
qc.Add("filter_cat[3]", "1");
|
qc.Add("filter_cat[4]", "1"); // SD Episode
|
||||||
|
qc.Add("filter_cat[5]", "1"); // HD Season
|
||||||
|
qc.Add("filter_cat[6]", "1"); // SD Season
|
||||||
|
}
|
||||||
|
|
||||||
return BrowseUrl + "?" + qc.GetQueryString();
|
return BrowseUrl + "?" + qc.GetQueryString();
|
||||||
}
|
}
|
||||||
@@ -263,7 +269,7 @@ namespace Jackett.Common.Indexers
|
|||||||
|
|
||||||
var category = torrent.QuerySelector(".cats_col div").GetAttribute("title");
|
var category = torrent.QuerySelector(".cats_col div").GetAttribute("title");
|
||||||
// default to Other
|
// default to Other
|
||||||
int categoryId = TorznabCatType.Other.ID;
|
var categoryId = TorznabCatType.Other.ID;
|
||||||
|
|
||||||
if (movies.Any(category.Contains))
|
if (movies.Any(category.Contains))
|
||||||
categoryId = TorznabCatType.Movies.ID;
|
categoryId = TorznabCatType.Movies.ID;
|
||||||
@@ -302,9 +308,9 @@ namespace Jackett.Common.Indexers
|
|||||||
/*const int USER_COL = 1;*/
|
/*const int USER_COL = 1;*/
|
||||||
|
|
||||||
|
|
||||||
string downloadAnchorHref = (downloadAnchor as IHtmlAnchorElement).Href;
|
var downloadAnchorHref = (downloadAnchor as IHtmlAnchorElement).Href;
|
||||||
var queryParams = HttpUtility.ParseQueryString(downloadAnchorHref, Encoding.UTF8);
|
var queryParams = HttpUtility.ParseQueryString(downloadAnchorHref, Encoding.UTF8);
|
||||||
string torrentId = queryParams["id"];
|
var torrentId = queryParams["id"];
|
||||||
|
|
||||||
var qFiles = row.QuerySelector("td:nth-last-child(" + FILES_COL + ")").TextContent;
|
var qFiles = row.QuerySelector("td:nth-last-child(" + FILES_COL + ")").TextContent;
|
||||||
|
|
||||||
@@ -325,10 +331,10 @@ namespace Jackett.Common.Indexers
|
|||||||
throw new Exception($"We expected 4 torrent datas.");
|
throw new Exception($"We expected 4 torrent datas.");
|
||||||
}
|
}
|
||||||
|
|
||||||
long size = ReleaseInfo.GetBytes(fileSize);
|
var size = ReleaseInfo.GetBytes(fileSize);
|
||||||
int grabs = int.Parse(snatched, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
var grabs = int.Parse(snatched, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
||||||
int seeders = int.Parse(seeds, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
var seeders = int.Parse(seeds, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
||||||
int leechers = int.Parse(leechs, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
var leechers = int.Parse(leechs, NumberStyles.AllowThousands, CultureInfo.InvariantCulture);
|
||||||
var detailsUri = new Uri(DetailsUrl + "?torrentid=" + torrentId);
|
var detailsUri = new Uri(DetailsUrl + "?torrentid=" + torrentId);
|
||||||
var downloadLink = new Uri(BrowseUrl + "?action=download&id=" + torrentId);
|
var downloadLink = new Uri(BrowseUrl + "?action=download&id=" + torrentId);
|
||||||
|
|
||||||
@@ -352,24 +358,6 @@ namespace Jackett.Common.Indexers
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Changes "Season 1" to "1"
|
|
||||||
private static int? SeasonToNumber(string season)
|
|
||||||
{
|
|
||||||
var seasonMatch = new Regex(@"Season (?<seasonNumber>\d{1,2})").Match(season);
|
|
||||||
if (seasonMatch.Success)
|
|
||||||
return int.Parse(seasonMatch.Groups["seasonNumber"].Value);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Changes "1" to "S01"
|
|
||||||
private static string SeasonNumberToShortSeason(int? season)
|
|
||||||
{
|
|
||||||
if (season == null)
|
|
||||||
return null;
|
|
||||||
return $"S{season:00}";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parse Error Messages from using CSS classes
|
/// Parse Error Messages from using CSS classes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -379,18 +367,10 @@ namespace Jackett.Common.Indexers
|
|||||||
{
|
{
|
||||||
var parser = new HtmlParser();
|
var parser = new HtmlParser();
|
||||||
var dom = parser.ParseDocument(response.ContentString);
|
var dom = parser.ParseDocument(response.ContentString);
|
||||||
var errorMessage = "Unknown Error";
|
var errorMessage = response.Status == System.Net.HttpStatusCode.Forbidden
|
||||||
|
? dom.QuerySelector(".time").Parent.TextContent.Trim()
|
||||||
|
: dom.QuerySelector(".flash.error").TextContent.Trim();
|
||||||
|
|
||||||
switch (response.Status)
|
|
||||||
{
|
|
||||||
case System.Net.HttpStatusCode.Forbidden:
|
|
||||||
errorMessage = dom.QuerySelector(".time").Parent.TextContent.Trim();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
errorMessage = dom.QuerySelector(".flash.error").TextContent.Trim();
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user