1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-30 19:58:39 +00:00

YTS: various improvements

This commit is contained in:
kaso17 2017-11-29 19:32:21 +01:00
parent 254b918a08
commit 570553f7d6

View file

@ -23,17 +23,11 @@ namespace Jackett.Indexers
"https://yts.ag/",
};
private Uri BaseUri
{
get { return new Uri(configData.Url.Value); }
set { configData.Url.Value = value.ToString(); }
}
private string ApiEndpoint { get { return SiteLink + "api/v2/list_movies.json"; } }
private string ApiEndpoint { get { return BaseUri + "api/v2/list_movies.json"; } }
private new ConfigurationDataUrl configData
private new ConfigurationData configData
{
get { return (ConfigurationDataUrl)base.configData; }
get { return (ConfigurationData)base.configData; }
set { base.configData = value; }
}
@ -46,7 +40,7 @@ namespace Jackett.Indexers
client: wc,
logger: l,
p: ps,
configData: new ConfigurationDataUrl(defaultSiteLink))
configData: new ConfigurationData())
{
Encoding = Encoding.GetEncoding("windows-1252");
Language = "en-us";
@ -142,7 +136,8 @@ namespace Jackett.Indexers
var release = new ReleaseInfo();
// Append the quality to the title because thats how radarr seems to be determining the quality?
release.Title = movie_item.Value<string>("title_long") + " " + torrent_info.Value<string>("quality");
// All releases are BRRips, see issue #2200
release.Title = movie_item.Value<string>("title_long") + " " + torrent_info.Value<string>("quality") + " BRRip";
var imdb = movie_item.Value<string>("imdb_code");
release.Imdb = ParseUtil.GetImdbID(imdb);
@ -164,15 +159,16 @@ namespace Jackett.Indexers
var dateStr = torrent_info.Value<string>("date_uploaded");
var dateTime = DateTime.ParseExact(dateStr, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
release.PublishDate = DateTime.SpecifyKind(dateTime, DateTimeKind.Utc).ToLocalTime();
release.Link = new Uri(torrent_info.Value<string>("url"));
release.Link = new Uri(torrent_info.Value<string>("url"));
release.Seeders = torrent_info.Value<int>("seeds");
release.Peers = torrent_info.Value<int>("peers") + release.Seeders;
release.Size = torrent_info.Value<long>("size_bytes");
release.DownloadVolumeFactor = 0;
release.UploadVolumeFactor = 1;
release.Comments = release.Link;
release.Guid = release.Comments;
release.Comments = new Uri(movie_item.Value<string>("url"));
release.BannerUrl = new Uri(movie_item.Value<string>("large_cover_image"));
release.Guid = release.Link;
// Hack to prevent adding non-specified catogery, since API doesn't seem to be working
string categories = string.Join(";", MapTorznabCapsToTrackers(query));