From d14554e45ba3290a7d6ba596c540ea630e709f24 Mon Sep 17 00:00:00 2001 From: KZ Date: Thu, 6 Aug 2015 22:35:35 +0100 Subject: [PATCH] Implement RuTor --- src/Jackett/Content/logos/rutor.png | Bin 0 -> 21490 bytes src/Jackett/Controllers/TorznabController.cs | 2 +- src/Jackett/Indexers/BaseIndexer.cs | 2 +- src/Jackett/Indexers/RUTor.cs | 225 ++++++++++++++++++ src/Jackett/Jackett.csproj | 7 +- .../IndexerConfig/ConfigurationDataRuTor.cs | 27 +++ src/Jackett/Utils/StringUtil.cs | 11 +- 7 files changed, 268 insertions(+), 6 deletions(-) create mode 100644 src/Jackett/Content/logos/rutor.png create mode 100644 src/Jackett/Indexers/RUTor.cs create mode 100644 src/Jackett/Models/IndexerConfig/ConfigurationDataRuTor.cs diff --git a/src/Jackett/Content/logos/rutor.png b/src/Jackett/Content/logos/rutor.png new file mode 100644 index 0000000000000000000000000000000000000000..603114c3f41946e1a4b39a67cf345268f765ff12 GIT binary patch literal 21490 zcmV)DK*7I>P)004R= z004l4008;_004mL004C`008P>0026e000+nl3&F}00009a7bBm000XS000XS0e@s) zkpKVy7<5HgbW?9;ba!ELWdLwtX>N2bZe?^JG%heMHD!e|WdHzER7pfZRCr#Ey$4(t z$J#!8&+P64*frJ|OL{jkMvX>|(P-4DF`A}Pqs9`AU1RShRgRk;$M@|s5crL8tZFotIEsk%8K3U%DyzDf7lQ^x*_V@`si^DVdM2F zA0=IFV?UhiKB0v3t&AD()<=HR82xQS^w|37F^y@TRA+sfoc!1GXQ4?+i8)zW#YH7} zmb%(H+&}KQrQmK+YmcKf8X6k#n00k^H8nL=YQYSYm6es2mSRqdii$8fD0z8#IXO9) zu8fR~)YR0htSk(`6rn~>Y;0_Jc=*$&PXhu19zA*#5)$(4*|X5l(BR-;)R^{`f_@Z? z)OMkPqIGHoo9M?Gw39?dMHLqpzdYeu(KcI(*7IMx(5A%1#FUhjq@*Nh0B%u(A9Y$< zng%~MHTZEEJT{a7&yQKav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`)sUt zpE$AG`o!LoC;vHncHfz^|Jd5@K5o79=<%(VmfH>=-hSxtCZxYxHZNGQcH_DqquqNJ zM6=vT%88`B2$mPg@}dYmC2_nmh1I4pAO~$IPhv%J>fQ*-kKjcyQfUIKO67GKyfKG2 zX2}g1a%GBCk{}htN_kN{KT^t%lnY}db)?u;mo7JED~24!l&eafVidI*>W2LBXHV>$ zKYz};^=rY*;qc&}VGpol?T23hDyAzjF)`^yNml(w?-6d!&o;F^lyvPY!IG6V|OPwpVRR zZ+%8zL+0!CX>XK7_sIz9l^obBA)r@$K(EBWJ}HmiO$+%XC;aoG*uj-aUo>P6HRKF4 z6^t+zer19bj4%}rH|2g=9KU_vu3c+Ztp$yT!D05H{V)cA1k5l?E&q!J)IbzHC>rqC zrTu?cwEy!)K|uj(w9$!Oz#cOU>=V?2Hfn6bF~B8Y+BLtcX#j`t8z%L=7d3k%^adHBAyOlseO zeY^kJyJzqIEt|L59+~HNdxX#J5nc{oc{vRCzBR(<)>t2hNr87Kd)*k}b8YD3+uyif z8SY^Hh3n<-1MV#da$Dwqf2r$@xtEXqa^?6;w`+g7-&pN_^Y8mt*SOhlb93Bx_v#*} zD|_x<-RFG$@NK(OXRMAM-m%we&w-0JXYDUuyK}|S<;I-{4leiYUG6)&xH-DGI=Gy( zvEH_M%bs0(px7XEh%+qI)Q=GeW(a!Fo d-IXiX{y)3*`U^|uM&keg002ovPDHLkV1h=wIA{O> literal 0 HcmV?d00001 diff --git a/src/Jackett/Controllers/TorznabController.cs b/src/Jackett/Controllers/TorznabController.cs index 621468a3a..515e62d44 100644 --- a/src/Jackett/Controllers/TorznabController.cs +++ b/src/Jackett/Controllers/TorznabController.cs @@ -89,7 +89,7 @@ namespace Jackett.Controllers } if (!string.IsNullOrWhiteSpace(torznabQuery.SanitizedSearchTerm)) { - logBuilder.AppendFormat(" for: {2} {3}", torznabQuery.SanitizedSearchTerm, torznabQuery.GetEpisodeSearchString()); + logBuilder.AppendFormat(" for: {0} {1}", torznabQuery.SanitizedSearchTerm, torznabQuery.GetEpisodeSearchString()); } logger.Info(logBuilder.ToString()); diff --git a/src/Jackett/Indexers/BaseIndexer.cs b/src/Jackett/Indexers/BaseIndexer.cs index ede51bec1..7c951004e 100644 --- a/src/Jackett/Indexers/BaseIndexer.cs +++ b/src/Jackett/Indexers/BaseIndexer.cs @@ -89,7 +89,7 @@ namespace Jackett.Indexers IsConfigured = false; } - protected void SaveConfig() + protected virtual void SaveConfig() { indexerService.SaveConfig(this as IIndexer, configData.ToJson(forDisplay: false)); } diff --git a/src/Jackett/Indexers/RUTor.cs b/src/Jackett/Indexers/RUTor.cs new file mode 100644 index 000000000..e43cd2248 --- /dev/null +++ b/src/Jackett/Indexers/RUTor.cs @@ -0,0 +1,225 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Jackett.Models; +using Newtonsoft.Json.Linq; +using NLog; +using Jackett.Utils; +using System.Net; +using System.Net.Http; +using CsQuery; +using System.Web; +using Jackett.Services; +using Jackett.Utils.Clients; +using System.Text.RegularExpressions; +using Jackett.Models.IndexerConfig; +using System.Globalization; +using Newtonsoft.Json; + +namespace Jackett.Indexers +{ + public class RuTor : BaseIndexer, IIndexer + { + private string SearchUrl { get { return SiteLink + "search/0/{0}/000/0/{1}"; } } + private string BrowseUrl { get { return SiteLink + "browse/0/{0}/0/0"; } } + readonly static string defaultSiteLink = "http://rutor.org/"; + + new ConfigurationDataRuTor configData + { + get { return (ConfigurationDataRuTor)base.configData; } + set { base.configData = value; } + } + + public RuTor(IIndexerManagerService i, Logger l, IWebClient wc) + : base(name: "RUTor", + description: "Свободный торрент трекер", + link: "http://rutor.org/", + caps: TorznabCapsUtil.CreateDefaultTorznabTVCaps(), + manager: i, + client: wc, + logger: l, + configData: new ConfigurationDataRuTor(defaultSiteLink)) + { + TorznabCaps.Categories.Add(TorznabCatType.Anime); + TorznabCaps.Categories.Add(TorznabCatType.Movies); + TorznabCaps.Categories.Add(TorznabCatType.Audio); + TorznabCaps.Categories.Add(TorznabCatType.Books); + } + + public async Task ApplyConfiguration(JToken configJson) + { + configData.LoadValuesFromJson(configJson); + var oldConfig = configData; + var releases = await PerformQuery(new TorznabQuery()); + + await ConfigureIfOK(string.Empty, releases.Count() > 0, () => + { + configData = oldConfig; + throw new Exception("Could not find releases from this URL"); + }); + } + + + protected override void SaveConfig() + { + indexerService.SaveConfig(this as IIndexer, JsonConvert.SerializeObject(configData)); + } + + // Override to load legacy config format + public override void LoadFromSavedConfiguration(JToken jsonConfig) + { + var json = jsonConfig.ToString(); + configData = JsonConvert.DeserializeObject(json); + IsConfigured = true; + } + + private readonly int CAT_ANY = 0; + private readonly int CAT_FOREIGN_MOVIE = 1; + // private readonly int CAT_OUR_MOVIES = 5; + // private readonly int CAT_POP_SCIFI_MOVIES = 12; + private readonly int CAT_TV_SERIES = 4; + // private readonly int CAT_TV = 6; + // private readonly int CAT_ANIMATION = 7; + private readonly int CAT_ANIME = 10; + private readonly int CAT_MUSIC = 2; + // private readonly int CAT_GAMES = 8; + // private readonly int CAT_SOFTWARE = 9; + // private readonly int CAT_SPORTS_HEALTH = 13; + // private readonly int CAT_HUMOR = 15; + // private readonly int CAT_ECONOMY_LIFE = 14; + private readonly int CAT_BOOKS = 11; + // private readonly int CAT_OTHER = 3; + + public async Task> PerformQuery(TorznabQuery query) + { + var releases = new List(); + var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString(); + var searchCategory = CAT_ANY; + + if(query.Categories.Contains(TorznabCatType.TV.ID) || + query.Categories.Contains(TorznabCatType.TVHD.ID)|| + query.Categories.Contains(TorznabCatType.TVSD.ID)){ + searchCategory = CAT_TV_SERIES; + } + + if ((searchCategory == CAT_ANY) && + (query.Categories.Contains(TorznabCatType.Movies.ID) || + query.Categories.Contains(TorznabCatType.MoviesForeign.ID) || + query.Categories.Contains(TorznabCatType.MoviesHD.ID) || + query.Categories.Contains(TorznabCatType.MoviesSD.ID))) + { + searchCategory = CAT_FOREIGN_MOVIE; + } + + if ((searchCategory == CAT_ANY) && + (query.Categories.Contains(TorznabCatType.Anime.ID))) + { + searchCategory = CAT_ANIME; + } + + if ((searchCategory == CAT_ANY) && + (query.Categories.Contains(TorznabCatType.Books.ID))) + { + searchCategory = CAT_BOOKS; + } + + if ((searchCategory == CAT_ANY) && + (query.Categories.Contains(TorznabCatType.Audio.ID) || + query.Categories.Contains(TorznabCatType.AudioLossless.ID) || + query.Categories.Contains(TorznabCatType.AudioLossy.ID))) + { + searchCategory = CAT_MUSIC; + } + + string queryUrl = string.Empty; + if (string.IsNullOrWhiteSpace(searchString)) + { + queryUrl = string.Format(BrowseUrl, searchCategory); + } else + { + queryUrl = string.Format(SearchUrl, searchCategory, HttpUtility.UrlEncode(searchString.Trim())); + } + + var results = await RequestStringWithCookiesAndRetry(queryUrl, string.Empty); + try + { + CQ dom = results.Content; + var rows = dom["#index table tr"]; + foreach (var row in rows.Skip(1)) + { + var release = new ReleaseInfo(); + + release.MinimumRatio = 1; + release.MinimumSeedTime = 172800; + + var date = StringUtil.StripNonAlphaNumeric(row.Cq().Find("td:eq(0)").Text().Trim() + .Replace("Янв", "01") + .Replace("Фев", "02") + .Replace("Мар", "03") + .Replace("Апр", "04") + .Replace("Май", "05") + .Replace("Июн", "06") + .Replace("Июл", "07") + .Replace("Авг", "08") + .Replace("Сен", "09") + .Replace("Окт", "10") + .Replace("Ноя", "11") + .Replace("Дек", "12")); + + release.PublishDate = DateTime.ParseExact(date, "ddMMyy", CultureInfo.InvariantCulture); + + release.Title = row.Cq().Find("td:eq(1)").Text().Trim(); + + if (configData.StripRussian.Value) + { + var split = release.Title.IndexOf('/'); + if (split > -1) + { + release.Title = release.Title.Substring(split + 1).Trim(); + } + } + + release.Description = release.Title; + + var hasComments = row.Cq().Find("td:eq(2) img").Length > 0; + var sizeCol = 2; + + if (hasComments) + sizeCol++; + + var sizeStr = StringUtil.StripRegex(row.Cq().Find("td:eq("+ sizeCol + ")").Text(), "[^a-zA-Z0-9\\. -]", " ").Trim(); + string[] sizeSplit = sizeStr.Split(' '); + release.Size = ReleaseInfo.GetBytes(sizeSplit[1].ToLower(), ParseUtil.CoerceFloat(sizeSplit[0])); + + release.Seeders = ParseUtil.CoerceInt(row.Cq().Find(".green").Text().Trim()); + release.Peers = ParseUtil.CoerceInt(row.Cq().Find(".red").Text().Trim()) + release.Seeders; + + release.Guid = new Uri(configData.Url.Value + row.Cq().Find("td:eq(1) a:eq(1)").Attr("href").Substring(1)); + release.Comments = release.Guid; + + var hasTorrent = row.Cq().Find("td:eq(1) a").Length == 3; + + if (hasTorrent) + { + release.Link = new Uri(row.Cq().Find("td:eq(1) a:eq(0)").Attr("href")); + release.MagnetUri = new Uri(row.Cq().Find("td:eq(1) a:eq(1)").Attr("href")); + } + else + { + release.MagnetUri = new Uri(row.Cq().Find("td:eq(1) a:eq(0)").Attr("href")); + } + + releases.Add(release); + } + } + catch (Exception ex) + { + OnParseError(results.Content, ex); + } + + return releases; + } + } +} diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj index 83ae8fbeb..ad391b285 100644 --- a/src/Jackett/Jackett.csproj +++ b/src/Jackett/Jackett.csproj @@ -190,6 +190,7 @@ + @@ -213,6 +214,7 @@ + @@ -241,7 +243,7 @@ - + @@ -418,6 +420,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/src/Jackett/Models/IndexerConfig/ConfigurationDataRuTor.cs b/src/Jackett/Models/IndexerConfig/ConfigurationDataRuTor.cs new file mode 100644 index 000000000..49c1024ea --- /dev/null +++ b/src/Jackett/Models/IndexerConfig/ConfigurationDataRuTor.cs @@ -0,0 +1,27 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.IndexerConfig +{ + public class ConfigurationDataRuTor : ConfigurationData + { + [JsonProperty] + public StringItem Url { get; private set; } + [JsonProperty] + public BoolItem StripRussian { get; private set; } + + public ConfigurationDataRuTor() + { + } + + public ConfigurationDataRuTor(string defaultUrl) + { + Url = new StringItem { Name = "Url", Value = defaultUrl }; + StripRussian = new BoolItem() { Name = "StripRusNamePrefix", Value = true }; + } + } +} diff --git a/src/Jackett/Utils/StringUtil.cs b/src/Jackett/Utils/StringUtil.cs index a8d045e35..ad024effa 100644 --- a/src/Jackett/Utils/StringUtil.cs +++ b/src/Jackett/Utils/StringUtil.cs @@ -13,10 +13,15 @@ namespace Jackett.Utils { public static class StringUtil { - public static string StripNonAlphaNumeric(string str) + public static string StripNonAlphaNumeric(string str, string replacement = "") { - Regex rgx = new Regex("[^a-zA-Z0-9 -]"); - str = rgx.Replace(str, ""); + return StripRegex(str, "[^a-zA-Z0-9 -]", replacement); + } + + public static string StripRegex(string str, string regex, string replacement = "") + { + Regex rgx = new Regex(regex); + str = rgx.Replace(str, replacement); return str; }