Removal of ILT (dead) and addition of GimmePeers (#988)

* Create gimmepeers.cs

Copied settings over from old ILoveTorrents config. As ILT is now defunct, GP is the official replacement, as announced back in fall 2016.

* Remove ILT and add GimmePeers

Removing defunct ILT and adding its replacement GP

* Rename gimmepeers.cs to GimmePeers.cs

* Update Jackett.csproj

Remove ILT and add GP

* Delete ILoveTorrents.cs

Removing ILT support as site is dead
This commit is contained in:
jamesb2147 2017-01-27 01:33:38 -06:00 committed by kaso17
parent c3b3dd5499
commit 79bed349d9
3 changed files with 188 additions and 188 deletions

View File

@ -63,6 +63,7 @@ Developer note: The software implements the [Torznab](https://github.com/Sonarr/
* FunkyTorrents * FunkyTorrents
* Fuzer * Fuzer
* Ghost City * Ghost City
* GimmePeers
* GODS * GODS
* Gormogon * Gormogon
* Hardbay * Hardbay
@ -77,7 +78,6 @@ Developer note: The software implements the [Torznab](https://github.com/Sonarr/
* House-of-Torrents * House-of-Torrents
* Hyperay * Hyperay
* ICE Torrent * ICE Torrent
* ILoveTorrents
* Immortalseed * Immortalseed
* Infinity-T * Infinity-T
* IPTorrents * IPTorrents
@ -87,7 +87,7 @@ Developer note: The software implements the [Torznab](https://github.com/Sonarr/
* LinkoManija * LinkoManija
* M-Team - TP * M-Team - TP
* Magico * Magico
* Mononoké-BT * Mononoké-BT
* MoreThanTV * MoreThanTV
* MyAnonamouse * MyAnonamouse
* myAmity * myAmity

View File

@ -1,184 +1,184 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using CsQuery; using CsQuery;
using CsQuery.ExtensionMethods.Internal; using CsQuery.ExtensionMethods.Internal;
using Jackett.Models; using Jackett.Models;
using Jackett.Models.IndexerConfig; using Jackett.Models.IndexerConfig;
using Jackett.Services; using Jackett.Services;
using Jackett.Utils; using Jackett.Utils;
using Jackett.Utils.Clients; using Jackett.Utils.Clients;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
namespace Jackett.Indexers namespace Jackett.Indexers
{ {
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public class ILoveTorrents : BaseIndexer, IIndexer public class GimmePeers : BaseIndexer, IIndexer
{ {
private string BrowseUrl => SiteLink + "browse.php"; private string BrowseUrl => SiteLink + "browse.php";
private string LoginUrl => SiteLink + "takelogin.php"; private string LoginUrl => SiteLink + "login.php";
new ConfigurationDataBasicLogin configData new ConfigurationDataBasicLogin configData
{ {
get { return (ConfigurationDataBasicLogin)base.configData; } get { return (ConfigurationDataBasicLogin)base.configData; }
set { base.configData = value; } set { base.configData = value; }
} }
public ILoveTorrents(IIndexerManagerService i, IWebClient wc, Logger l, IProtectionService ps) public GimmePeers(IIndexerManagerService i, IWebClient wc, Logger l, IProtectionService ps)
: base(name: "ILoveTorrents", : base(name: "GimmePeers",
description: "ILT", description: "Formerly ILT",
link: "https://www.ilovetorrents.me/", link: "https://www.gimmepeers.com/",
caps: new TorznabCapabilities(), caps: new TorznabCapabilities(),
manager: i, manager: i,
client: wc, client: wc,
logger: l, logger: l,
p: ps, p: ps,
configData: new ConfigurationDataBasicLogin()) configData: new ConfigurationDataBasicLogin())
{ {
Encoding = Encoding.GetEncoding("iso-8859-1"); Encoding = Encoding.GetEncoding("iso-8859-1");
Language = "en-us"; Language = "en-us";
AddCategoryMapping(85, TorznabCatType.Movies3D); AddCategoryMapping(85, TorznabCatType.Movies3D);
AddCategoryMapping(23, TorznabCatType.TVAnime); AddCategoryMapping(23, TorznabCatType.TVAnime);
AddCategoryMapping(24, TorznabCatType.BooksEbook); AddCategoryMapping(24, TorznabCatType.BooksEbook);
AddCategoryMapping(4, TorznabCatType.PCGames); AddCategoryMapping(4, TorznabCatType.PCGames);
AddCategoryMapping(38, TorznabCatType.ConsolePS3); AddCategoryMapping(38, TorznabCatType.ConsolePS3);
AddCategoryMapping(38, TorznabCatType.ConsolePS4); AddCategoryMapping(38, TorznabCatType.ConsolePS4);
AddCategoryMapping(38, TorznabCatType.ConsolePSP); AddCategoryMapping(38, TorznabCatType.ConsolePSP);
AddCategoryMapping(43, TorznabCatType.ConsoleWii); AddCategoryMapping(43, TorznabCatType.ConsoleWii);
AddCategoryMapping(43, TorznabCatType.ConsoleWiiU); AddCategoryMapping(43, TorznabCatType.ConsoleWiiU);
AddCategoryMapping(12, TorznabCatType.ConsoleXBOX360DLC); AddCategoryMapping(12, TorznabCatType.ConsoleXBOX360DLC);
AddCategoryMapping(12, TorznabCatType.ConsoleXbox); AddCategoryMapping(12, TorznabCatType.ConsoleXbox);
AddCategoryMapping(12, TorznabCatType.ConsoleXbox360); AddCategoryMapping(12, TorznabCatType.ConsoleXbox360);
AddCategoryMapping(12, TorznabCatType.ConsoleXboxOne); AddCategoryMapping(12, TorznabCatType.ConsoleXboxOne);
AddCategoryMapping(6, TorznabCatType.Audio); AddCategoryMapping(6, TorznabCatType.Audio);
AddCategoryMapping(7, TorznabCatType.TV); AddCategoryMapping(7, TorznabCatType.TV);
AddCategoryMapping(40, TorznabCatType.TVSD); AddCategoryMapping(40, TorznabCatType.TVSD);
AddCategoryMapping(8, TorznabCatType.TVHD); AddCategoryMapping(8, TorznabCatType.TVHD);
AddCategoryMapping(9, TorznabCatType.XXX); AddCategoryMapping(9, TorznabCatType.XXX);
AddCategoryMapping(11, TorznabCatType.XXXDVD); AddCategoryMapping(11, TorznabCatType.XXXDVD);
AddCategoryMapping(10, TorznabCatType.XXXx264); AddCategoryMapping(10, TorznabCatType.XXXx264);
AddCategoryMapping(80, TorznabCatType.MoviesBluRay); AddCategoryMapping(80, TorznabCatType.MoviesBluRay);
AddCategoryMapping(20, TorznabCatType.MoviesDVD); AddCategoryMapping(20, TorznabCatType.MoviesDVD);
AddCategoryMapping(41, TorznabCatType.MoviesHD); AddCategoryMapping(41, TorznabCatType.MoviesHD);
AddCategoryMapping(19, TorznabCatType.Movies); AddCategoryMapping(19, TorznabCatType.Movies);
} }
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson) public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{ {
LoadValuesFromJson(configJson); LoadValuesFromJson(configJson);
var pairs = new Dictionary<string, string> { var pairs = new Dictionary<string, string> {
{ "username", configData.Username.Value }, { "username", configData.Username.Value },
{ "password", configData.Password.Value }, { "password", configData.Password.Value },
{ "returnto", "/" }, { "returnto", "/" },
{ "login", "Log in!" } { "login", "Log in!" }
}; };
var loginPage = await RequestStringWithCookies(SiteLink, string.Empty); var loginPage = await RequestStringWithCookies(SiteLink, string.Empty);
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, SiteLink, SiteLink); var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, SiteLink, SiteLink);
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () => await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
{ {
CQ dom = result.Content; CQ dom = result.Content;
var messageEl = dom["body > div"].First(); var messageEl = dom["body > div"].First();
var errorMessage = messageEl.Text().Trim(); var errorMessage = messageEl.Text().Trim();
throw new ExceptionWithConfigData(errorMessage, configData); throw new ExceptionWithConfigData(errorMessage, configData);
}); });
return IndexerConfigurationStatus.RequiresTesting; return IndexerConfigurationStatus.RequiresTesting;
} }
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query) public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{ {
var releases = new List<ReleaseInfo>(); var releases = new List<ReleaseInfo>();
var searchString = query.GetQueryString(); var searchString = query.GetQueryString();
var searchUrl = BrowseUrl; var searchUrl = BrowseUrl;
var trackerCats = MapTorznabCapsToTrackers(query); var trackerCats = MapTorznabCapsToTrackers(query);
var queryCollection = new NameValueCollection(); var queryCollection = new NameValueCollection();
// Tracker can only search OR return things in categories // Tracker can only search OR return things in categories
if (!string.IsNullOrWhiteSpace(searchString)) if (!string.IsNullOrWhiteSpace(searchString))
{ {
queryCollection.Add("search", searchString); queryCollection.Add("search", searchString);
queryCollection.Add("cat", "0"); queryCollection.Add("cat", "0");
} }
else else
{ {
foreach (var cat in MapTorznabCapsToTrackers(query)) foreach (var cat in MapTorznabCapsToTrackers(query))
{ {
queryCollection.Add("c" + cat, "1"); queryCollection.Add("c" + cat, "1");
} }
queryCollection.Add("incldead", "0"); queryCollection.Add("incldead", "0");
} }
searchUrl += "?" + queryCollection.GetQueryString(); searchUrl += "?" + queryCollection.GetQueryString();
await ProcessPage(releases, searchUrl); await ProcessPage(releases, searchUrl);
return releases; return releases;
} }
private async Task ProcessPage(List<ReleaseInfo> releases, string searchUrl) private async Task ProcessPage(List<ReleaseInfo> releases, string searchUrl)
{ {
var response = await RequestStringWithCookiesAndRetry(searchUrl, null, BrowseUrl); var response = await RequestStringWithCookiesAndRetry(searchUrl, null, BrowseUrl);
var results = response.Content; var results = response.Content;
try try
{ {
CQ dom = results; CQ dom = results;
var rows = dom[".koptekst tr"]; var rows = dom[".koptekst tr"];
foreach (var row in rows.Skip(1)) foreach (var row in rows.Skip(1))
{ {
var release = new ReleaseInfo(); var release = new ReleaseInfo();
var link = row.Cq().Find("td:eq(1) a:eq(0)").First(); var link = row.Cq().Find("td:eq(1) a:eq(0)").First();
release.Guid = new Uri(SiteLink + link.Attr("href")); release.Guid = new Uri(SiteLink + link.Attr("href"));
release.Comments = release.Guid; release.Comments = release.Guid;
release.Title = link.Text().Trim(); release.Title = link.Text().Trim();
release.Description = release.Title; release.Description = release.Title;
// If we search an get no results, we still get a table just with no info. // If we search an get no results, we still get a table just with no info.
if (string.IsNullOrWhiteSpace(release.Title)) if (string.IsNullOrWhiteSpace(release.Title))
{ {
break; break;
} }
// Check if the release has been assigned a category // Check if the release has been assigned a category
if (row.Cq().Find("td:eq(0) a").Length > 0) if (row.Cq().Find("td:eq(0) a").Length > 0)
{ {
var cat = row.Cq().Find("td:eq(0) a").First().Attr("href").Substring(15); var cat = row.Cq().Find("td:eq(0) a").First().Attr("href").Substring(15);
release.Category = MapTrackerCatToNewznab(cat); release.Category = MapTrackerCatToNewznab(cat);
} }
var qLink = row.Cq().Find("td:eq(2) a").First(); var qLink = row.Cq().Find("td:eq(2) a").First();
release.Link = new Uri(SiteLink + qLink.Attr("href")); release.Link = new Uri(SiteLink + qLink.Attr("href"));
var added = row.Cq().Find("td:eq(7)").First().Text().Trim(); var added = row.Cq().Find("td:eq(7)").First().Text().Trim();
var date = added.Substring(0, 10); var date = added.Substring(0, 10);
var time = added.Substring(12, 8); var time = added.Substring(12, 8);
var dateTime = date + time; var dateTime = date + time;
release.PublishDate = DateTime.ParseExact(dateTime, "yyyy-MM-ddHH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToLocalTime(); release.PublishDate = DateTime.ParseExact(dateTime, "yyyy-MM-ddHH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToLocalTime();
var sizeStr = row.Cq().Find("td:eq(8)").First().Text().Trim(); var sizeStr = row.Cq().Find("td:eq(8)").First().Text().Trim();
release.Size = ReleaseInfo.GetBytes(sizeStr); release.Size = ReleaseInfo.GetBytes(sizeStr);
release.Seeders = ParseUtil.CoerceInt(row.Cq().Find("td:eq(10)").First().Text().Trim()); release.Seeders = ParseUtil.CoerceInt(row.Cq().Find("td:eq(10)").First().Text().Trim());
release.Peers = ParseUtil.CoerceInt(row.Cq().Find("td:eq(11)").First().Text().Trim()) + release.Seeders; release.Peers = ParseUtil.CoerceInt(row.Cq().Find("td:eq(11)").First().Text().Trim()) + release.Seeders;
releases.Add(release); releases.Add(release);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
OnParseError(results, ex); OnParseError(results, ex);
} }
} }
} }
} }

View File

@ -228,7 +228,7 @@
<Compile Include="Indexers\Abnormal.cs" /> <Compile Include="Indexers\Abnormal.cs" />
<Compile Include="Indexers\Fuzer.cs" /> <Compile Include="Indexers\Fuzer.cs" />
<Compile Include="Indexers\GFTracker.cs" /> <Compile Include="Indexers\GFTracker.cs" />
<Compile Include="Indexers\ILoveTorrents.cs" /> <Compile Include="Indexers\GimmePeers.cs" />
<Compile Include="Indexers\RevolutionTT.cs" /> <Compile Include="Indexers\RevolutionTT.cs" />
<Compile Include="Indexers\TehConnection.cs" /> <Compile Include="Indexers\TehConnection.cs" />
<Compile Include="Indexers\Hounddawgs.cs" /> <Compile Include="Indexers\Hounddawgs.cs" />
@ -761,4 +761,4 @@
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" /> <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target> </Target>
</Project> </Project>