mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -215,10 +215,10 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
searchQuery.Discount = "FREE";
|
searchQuery.Discount = "FREE";
|
||||||
}
|
}
|
||||||
|
|
||||||
var ApiUrl = "https://api." + $"{SiteLink}".Substring(SiteLink.IndexOf('.') + 1);
|
var apiUrl = "https://api." + $"{SiteLink}".Substring(SiteLink.IndexOf('.') + 1);
|
||||||
|
|
||||||
var response = await RequestWithCookiesAndRetryAsync(
|
var response = await RequestWithCookiesAndRetryAsync(
|
||||||
$"{ApiUrl}api/torrent/search",
|
$"{apiUrl}api/torrent/search",
|
||||||
method: RequestType.POST,
|
method: RequestType.POST,
|
||||||
rawbody: STJson.ToJson(searchQuery),
|
rawbody: STJson.ToJson(searchQuery),
|
||||||
headers: new Dictionary<string, string>
|
headers: new Dictionary<string, string>
|
||||||
@@ -240,6 +240,13 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
|
|
||||||
if (jsonResponse?.Data?.Torrents == null)
|
if (jsonResponse?.Data?.Torrents == null)
|
||||||
{
|
{
|
||||||
|
if (jsonResponse != null &&
|
||||||
|
jsonResponse.Message.IsNotNullOrWhiteSpace() &&
|
||||||
|
jsonResponse.Message.ToUpperInvariant() != "SUCCESS")
|
||||||
|
{
|
||||||
|
throw new Exception($"Invalid response received from M-Team. Response from API: {jsonResponse.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
return releases;
|
return releases;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +254,7 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
{
|
{
|
||||||
var torrentId = int.Parse(torrent.Id);
|
var torrentId = int.Parse(torrent.Id);
|
||||||
var infoUrl = new Uri($"{SiteLink}detail/{torrentId}");
|
var infoUrl = new Uri($"{SiteLink}detail/{torrentId}");
|
||||||
var downloadUrl = new Uri($"{ApiUrl}api/torrent/genDlToken?id={torrentId}");
|
var downloadUrl = new Uri($"{apiUrl}api/torrent/genDlToken?id={torrentId}");
|
||||||
|
|
||||||
var release = new ReleaseInfo
|
var release = new ReleaseInfo
|
||||||
{
|
{
|
||||||
@@ -330,6 +337,7 @@ namespace Jackett.Common.Indexers.Definitions
|
|||||||
internal class MTeamTpApiResponse
|
internal class MTeamTpApiResponse
|
||||||
{
|
{
|
||||||
public MTeamTpApiData Data { get; set; }
|
public MTeamTpApiData Data { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class MTeamTpApiData
|
internal class MTeamTpApiData
|
||||||
|
Reference in New Issue
Block a user