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