mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
YTS: fix API
This commit is contained in:
@@ -78,6 +78,10 @@ namespace Jackett.Common.Indexers
|
|||||||
|
|
||||||
var queryCollection = new NameValueCollection();
|
var queryCollection = new NameValueCollection();
|
||||||
|
|
||||||
|
// without this the API sometimes returns nothing
|
||||||
|
queryCollection.Add("sort", "date_added");
|
||||||
|
queryCollection.Add("limit", "50");
|
||||||
|
|
||||||
if (query.ImdbID != null)
|
if (query.ImdbID != null)
|
||||||
{
|
{
|
||||||
queryCollection.Add("query_term", query.ImdbID);
|
queryCollection.Add("query_term", query.ImdbID);
|
||||||
@@ -131,7 +135,11 @@ namespace Jackett.Common.Indexers
|
|||||||
return releases.ToArray();
|
return releases.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var movie_item in data_items.Value<JToken>("movies"))
|
var movies = data_items.Value<JToken>("movies");
|
||||||
|
if (movies == null)
|
||||||
|
throw new Exception("API error, movies missing");
|
||||||
|
|
||||||
|
foreach (var movie_item in movies)
|
||||||
{
|
{
|
||||||
var torrents = movie_item.Value<JArray>("torrents");
|
var torrents = movie_item.Value<JArray>("torrents");
|
||||||
if (torrents == null)
|
if (torrents == null)
|
||||||
|
Reference in New Issue
Block a user