mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Fix RARBG magnet link
This commit is contained in:
@@ -124,18 +124,27 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
var jsonContent = JObject.Parse(response.Content);
|
var jsonContent = JObject.Parse(response.Content);
|
||||||
|
|
||||||
if (jsonContent.Value<int>("error_code") == 20) // no results found
|
int errorCode = jsonContent.Value<int>("error_code");
|
||||||
|
if (errorCode == 20) // no results found
|
||||||
{
|
{
|
||||||
return releases.ToArray();
|
return releases.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (errorCode > 0) // too many requests per second
|
||||||
|
{
|
||||||
|
throw new Exception(jsonContent.Value<string>("error"));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var item in jsonContent.Value<JArray>("torrent_results"))
|
foreach (var item in jsonContent.Value<JArray>("torrent_results"))
|
||||||
{
|
{
|
||||||
var release = new ReleaseInfo();
|
var release = new ReleaseInfo();
|
||||||
release.Title = item.Value<string>("title");
|
release.Title = item.Value<string>("title");
|
||||||
release.Description = release.Title;
|
release.Description = release.Title;
|
||||||
release.Category = MapTrackerCatToNewznab(categoryLabels[item.Value<string>("category")].ToString());
|
release.Category = MapTrackerCatToNewznab(categoryLabels[item.Value<string>("category")].ToString());
|
||||||
release.Link = new Uri(item.Value<string>("download"));
|
|
||||||
|
release.MagnetUri = new Uri(item.Value<string>("download"));
|
||||||
|
release.InfoHash = release.MagnetUri.ToString().Split(':')[3].Split('&')[0];
|
||||||
|
|
||||||
release.Comments = new Uri(item.Value<string>("info_page"));
|
release.Comments = new Uri(item.Value<string>("info_page"));
|
||||||
release.Guid = release.Comments;
|
release.Guid = release.Comments;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user