mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-13 23:44:10 +02:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a6899343a | ||
![]() |
56bbee2f1f | ||
![]() |
b58566c782 | ||
![]() |
dd31c249fd | ||
![]() |
c6357bf30f | ||
![]() |
e0e3c12d5e | ||
![]() |
8e0b138086 | ||
![]() |
a6213c1b9a | ||
![]() |
9ffa461ae3 | ||
![]() |
257fbc07b2 | ||
![]() |
8d08279895 | ||
![]() |
edb629adb4 | ||
![]() |
43b0403ab4 | ||
![]() |
7cf55f41d6 |
@@ -31,6 +31,11 @@ Download in the [Releases page](https://github.com/zone117x/Jackett/releases)
|
|||||||
* [RARBG](https://rarbg.com)
|
* [RARBG](https://rarbg.com)
|
||||||
* [TorrentDay](https://torrentday.eu/)
|
* [TorrentDay](https://torrentday.eu/)
|
||||||
* [TorrentShack](http://torrentshack.me/)
|
* [TorrentShack](http://torrentshack.me/)
|
||||||
|
* AlphaRatio
|
||||||
|
* AnimeBytes
|
||||||
|
* SceneAccess
|
||||||
|
* ShowRSS
|
||||||
|
* Torrentz
|
||||||
|
|
||||||
|
|
||||||
### Additional Trackers
|
### Additional Trackers
|
||||||
|
@@ -10,8 +10,6 @@
|
|||||||
<RootNamespace>CurlSharp</RootNamespace>
|
<RootNamespace>CurlSharp</RootNamespace>
|
||||||
<AssemblyName>CurlSharp</AssemblyName>
|
<AssemblyName>CurlSharp</AssemblyName>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProductVersion>12.0.0</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -86,4 +84,14 @@
|
|||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
|
<ProjectExtensions>
|
||||||
|
<MonoDevelop>
|
||||||
|
<Properties>
|
||||||
|
<Policies>
|
||||||
|
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||||
|
<CSharpFormattingPolicy IndentSwitchBody="True" IndentBlocksInsideExpressions="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="DoNotCare" ArrayInitializerWrapping="DoNotChange" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" NewLineBeforeConstructorInitializerColon="NewLine" NewLineAfterConstructorInitializerColon="SameLine" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||||
|
</Policies>
|
||||||
|
</Properties>
|
||||||
|
</MonoDevelop>
|
||||||
|
</ProjectExtensions>
|
||||||
</Project>
|
</Project>
|
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2013
|
# Visual Studio 2012
|
||||||
VisualStudioVersion = 12.0.31101.0
|
VisualStudioVersion = 12.0.31101.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett", "Jackett\Jackett.csproj", "{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett", "Jackett\Jackett.csproj", "{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}"
|
||||||
@@ -12,14 +13,49 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.Build.0 = Release|Any CPU
|
{74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
|
Policies = $0
|
||||||
|
$0.TextStylePolicy = $1
|
||||||
|
$1.inheritsSet = VisualStudio
|
||||||
|
$1.inheritsScope = text/plain
|
||||||
|
$1.scope = text/x-csharp
|
||||||
|
$0.CSharpFormattingPolicy = $2
|
||||||
|
$2.IndentSwitchBody = True
|
||||||
|
$2.IndentBlocksInsideExpressions = True
|
||||||
|
$2.AnonymousMethodBraceStyle = NextLine
|
||||||
|
$2.PropertyBraceStyle = NextLine
|
||||||
|
$2.PropertyGetBraceStyle = NextLine
|
||||||
|
$2.PropertySetBraceStyle = NextLine
|
||||||
|
$2.EventBraceStyle = NextLine
|
||||||
|
$2.EventAddBraceStyle = NextLine
|
||||||
|
$2.EventRemoveBraceStyle = NextLine
|
||||||
|
$2.StatementBraceStyle = NextLine
|
||||||
|
$2.ElseNewLinePlacement = NewLine
|
||||||
|
$2.CatchNewLinePlacement = NewLine
|
||||||
|
$2.FinallyNewLinePlacement = NewLine
|
||||||
|
$2.WhileNewLinePlacement = DoNotCare
|
||||||
|
$2.ArrayInitializerWrapping = DoNotChange
|
||||||
|
$2.ArrayInitializerBraceStyle = NextLine
|
||||||
|
$2.BeforeMethodDeclarationParentheses = False
|
||||||
|
$2.BeforeMethodCallParentheses = False
|
||||||
|
$2.BeforeConstructorDeclarationParentheses = False
|
||||||
|
$2.NewLineBeforeConstructorInitializerColon = NewLine
|
||||||
|
$2.NewLineAfterConstructorInitializerColon = SameLine
|
||||||
|
$2.BeforeDelegateDeclarationParentheses = False
|
||||||
|
$2.NewParentheses = False
|
||||||
|
$2.SpacesBeforeBrackets = False
|
||||||
|
$2.inheritsSet = Mono
|
||||||
|
$2.inheritsScope = text/x-csharp
|
||||||
|
$2.scope = text/x-csharp
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
36
src/Jackett/CachedResult.cs
Normal file
36
src/Jackett/CachedResult.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Jackett
|
||||||
|
{
|
||||||
|
public class CachedResult
|
||||||
|
{
|
||||||
|
private List<ReleaseInfo> results;
|
||||||
|
private DateTime created;
|
||||||
|
private string query;
|
||||||
|
|
||||||
|
public CachedResult(string query, List<ReleaseInfo> results){
|
||||||
|
this.results = results;
|
||||||
|
created = DateTime.Now;
|
||||||
|
this.query = query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyList<ReleaseInfo> Results
|
||||||
|
{
|
||||||
|
get { return results.AsReadOnly(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime Created
|
||||||
|
{
|
||||||
|
get { return created; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Query
|
||||||
|
{
|
||||||
|
get { return query; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
src/Jackett/ConfigurationDataBasicLoginAnimeBytes.cs
Normal file
27
src/Jackett/ConfigurationDataBasicLoginAnimeBytes.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Jackett
|
||||||
|
{
|
||||||
|
public class ConfigurationDataBasicLoginAnimeBytes : ConfigurationDataBasicLogin
|
||||||
|
{
|
||||||
|
public BoolItem IncludeRaw { get; private set; }
|
||||||
|
public DisplayItem RageIdWarning { get; private set; }
|
||||||
|
public DisplayItem DateWarning { get; private set; }
|
||||||
|
|
||||||
|
public ConfigurationDataBasicLoginAnimeBytes(): base()
|
||||||
|
{
|
||||||
|
IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false };
|
||||||
|
RageIdWarning = new DisplayItem("Ensure rageid lookup is disabled in Sonarr for this tracker.") { Name = "RageWarning" };
|
||||||
|
DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Item[] GetItems()
|
||||||
|
{
|
||||||
|
return new Item[] { Username, Password, IncludeRaw, RageIdWarning, DateWarning };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -5,29 +5,53 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace Jackett
|
namespace Jackett
|
||||||
{
|
{
|
||||||
public static class CookieContainerExtensions
|
public static class CookieContainerExtensions
|
||||||
{
|
{
|
||||||
public static void FillFromJson (this CookieContainer cookies, Uri uri, JArray json)
|
|
||||||
{
|
|
||||||
foreach (string cookie in json) {
|
|
||||||
|
|
||||||
var w = cookie.Split ('=');
|
public static void FillFromJson(this CookieContainer cookies, Uri uri, JToken json)
|
||||||
if (w.Length == 1)
|
{
|
||||||
cookies.Add (uri, new Cookie{ Name = cookie.Trim () });
|
if (json["cookies"] != null)
|
||||||
else
|
{
|
||||||
cookies.Add (uri, new Cookie (w [0].Trim (), w [1].Trim ()));
|
var cookieArray = (JArray)json["cookies"];
|
||||||
}
|
foreach (string cookie in cookieArray)
|
||||||
}
|
{
|
||||||
|
var w = cookie.Split('=');
|
||||||
|
if (w.Length == 1)
|
||||||
|
{
|
||||||
|
cookies.Add(uri, new Cookie { Name = cookie.Trim() });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cookies.Add(uri, new Cookie(w[0].Trim(), w[1].Trim()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static JArray ToJson (this CookieContainer cookies, Uri baseUrl)
|
if (json["cookie_header"] != null)
|
||||||
{
|
{
|
||||||
return new JArray ((
|
var cfh = (string)json["cookie_header"];
|
||||||
from cookie in cookies.GetCookies (baseUrl).Cast<Cookie> ()
|
var cookieHeaders = ((string)json["cookie_header"]).Split(';');
|
||||||
select cookie.Name.Trim () + "=" + cookie.Value.Trim ()
|
foreach (var c in cookieHeaders)
|
||||||
).ToArray ());
|
{
|
||||||
}
|
try
|
||||||
}
|
{
|
||||||
|
cookies.SetCookies(uri, c);
|
||||||
|
}
|
||||||
|
catch (CookieException ex)
|
||||||
|
{
|
||||||
|
Program.LoggerInstance.Info("(Non-critical) Problem loading cookie {0}, {1}, {2}", uri, c, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DumpToJson(this CookieContainer cookies, Uri uri, JToken json)
|
||||||
|
{
|
||||||
|
json["cookie_header"] = cookies.GetCookieHeader(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,16 +75,13 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public async Task ApplyConfiguration(JToken configJson)
|
public async Task ApplyConfiguration(JToken configJson)
|
||||||
{
|
{
|
||||||
cookies = new CookieContainer();
|
|
||||||
client = new HttpClient(handler);
|
|
||||||
|
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
var config = new ConfigurationDataBasicLogin();
|
var config = new ConfigurationDataBasicLogin();
|
||||||
config.LoadValuesFromJson(configJson);
|
config.LoadValuesFromJson(configJson);
|
||||||
|
|
||||||
var pairs = new Dictionary<string, string> {
|
var pairs = new Dictionary<string, string> {
|
||||||
{ "username", config.Username.Value },
|
{ "username", config.Username.Value },
|
||||||
{ "password", @config.Password.Value },
|
{ "password", @config.Password.Value },
|
||||||
@@ -95,17 +92,18 @@ namespace Jackett.Indexers
|
|||||||
var content = new FormUrlEncodedContent(pairs);
|
var content = new FormUrlEncodedContent(pairs);
|
||||||
var message = CreateHttpRequest(new Uri(LoginUrl));
|
var message = CreateHttpRequest(new Uri(LoginUrl));
|
||||||
message.Content = content;
|
message.Content = content;
|
||||||
|
|
||||||
//message.Headers.Referrer = new Uri(LoginUrl);
|
//message.Headers.Referrer = new Uri(LoginUrl);
|
||||||
string responseContent;
|
string responseContent;
|
||||||
JArray cookieJArray;
|
|
||||||
|
configSaveData = new JObject();
|
||||||
|
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
{
|
{
|
||||||
// If Windows use .net http
|
// If Windows use .net http
|
||||||
var response = await client.SendAsync(message);
|
var response = await client.SendAsync(message);
|
||||||
responseContent = await response.Content.ReadAsStringAsync();
|
responseContent = await response.Content.ReadAsStringAsync();
|
||||||
cookieJArray = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -113,7 +111,7 @@ namespace Jackett.Indexers
|
|||||||
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
||||||
responseContent = Encoding.UTF8.GetString(response.Content);
|
responseContent = Encoding.UTF8.GetString(response.Content);
|
||||||
cookieHeader = response.CookieHeader;
|
cookieHeader = response.CookieHeader;
|
||||||
cookieJArray = new JArray(response.CookiesFlat);
|
configSaveData["cookie_header"] = cookieHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!responseContent.Contains("logout.php?"))
|
if (!responseContent.Contains("logout.php?"))
|
||||||
@@ -126,8 +124,6 @@ namespace Jackett.Indexers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
configSaveData = new JObject();
|
|
||||||
configSaveData["cookies"] = cookieJArray;
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
@@ -146,7 +142,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(SiteLink, (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(SiteLink, jsonConfig);
|
||||||
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
388
src/Jackett/Indexers/AnimeBytes.cs
Normal file
388
src/Jackett/Indexers/AnimeBytes.cs
Normal file
@@ -0,0 +1,388 @@
|
|||||||
|
using CsQuery;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace Jackett.Indexers
|
||||||
|
{
|
||||||
|
public class AnimeBytes : IndexerInterface
|
||||||
|
{
|
||||||
|
private static List<CachedResult> cache = new List<CachedResult>();
|
||||||
|
private static readonly TimeSpan cacheTime = new TimeSpan(0, 9, 0);
|
||||||
|
|
||||||
|
public event Action<IndexerInterface, string, Exception> OnResultParsingError;
|
||||||
|
public event Action<IndexerInterface, JToken> OnSaveConfigurationRequested;
|
||||||
|
|
||||||
|
static string chromeUserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36";
|
||||||
|
|
||||||
|
public string DisplayName
|
||||||
|
{
|
||||||
|
get { return "AnimeBytes"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string DisplayDescription
|
||||||
|
{
|
||||||
|
get { return "The web's best Chinese cartoons"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Uri SiteLink
|
||||||
|
{
|
||||||
|
get { return new Uri(BaseUrl); }
|
||||||
|
}
|
||||||
|
|
||||||
|
const string BaseUrl = "https://animebytes.tv";
|
||||||
|
const string LoginUrl = BaseUrl + "/user/login";
|
||||||
|
const string SearchUrl = BaseUrl + "/torrents.php?filter_cat[1]=1";
|
||||||
|
|
||||||
|
public bool IsConfigured { get; private set; }
|
||||||
|
public bool AllowRaws { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
CookieContainer cookieContainer;
|
||||||
|
HttpClientHandler handler;
|
||||||
|
HttpClient client;
|
||||||
|
|
||||||
|
public AnimeBytes()
|
||||||
|
{
|
||||||
|
IsConfigured = false;
|
||||||
|
cookieContainer = new CookieContainer();
|
||||||
|
handler = new HttpClientHandler
|
||||||
|
{
|
||||||
|
CookieContainer = cookieContainer,
|
||||||
|
AllowAutoRedirect = false,
|
||||||
|
UseCookies = true,
|
||||||
|
};
|
||||||
|
client = new HttpClient(handler);
|
||||||
|
client.DefaultRequestHeaders.Add("User-Agent", chromeUserAgent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<ConfigurationData> GetConfigurationForSetup()
|
||||||
|
{
|
||||||
|
var config = new ConfigurationDataBasicLoginAnimeBytes();
|
||||||
|
return Task.FromResult<ConfigurationData>(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task ApplyConfiguration(JToken configJson)
|
||||||
|
{
|
||||||
|
var config = new ConfigurationDataBasicLoginAnimeBytes();
|
||||||
|
config.LoadValuesFromJson(configJson);
|
||||||
|
|
||||||
|
|
||||||
|
// Get the login form as we need the CSRF Token
|
||||||
|
var loginPage = await client.GetAsync(LoginUrl);
|
||||||
|
CQ loginPageDom = await loginPage.Content.ReadAsStringAsync();
|
||||||
|
var csrfToken = loginPageDom["input[name=\"csrf_token\"]"].Last();
|
||||||
|
|
||||||
|
// Build login form
|
||||||
|
var pairs = new Dictionary<string, string> {
|
||||||
|
{ "csrf_token", csrfToken.Attr("value") },
|
||||||
|
{ "username", config.Username.Value },
|
||||||
|
{ "password", config.Password.Value },
|
||||||
|
{ "keeplogged_sent", "true" },
|
||||||
|
{ "keeplogged", "on" },
|
||||||
|
{ "login", "Log In!" }
|
||||||
|
};
|
||||||
|
|
||||||
|
var content = new FormUrlEncodedContent(pairs);
|
||||||
|
|
||||||
|
// Do the login
|
||||||
|
var response = await client.PostAsync(LoginUrl, content);
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Compatiblity issue between the cookie format and httpclient
|
||||||
|
// Pull it out manually ignoring the expiry date then set it manually
|
||||||
|
// http://stackoverflow.com/questions/14681144/httpclient-not-storing-cookies-in-cookiecontainer
|
||||||
|
IEnumerable<string> cookies;
|
||||||
|
if (response.Headers.TryGetValues("set-cookie", out cookies))
|
||||||
|
{
|
||||||
|
foreach (var c in cookies)
|
||||||
|
{
|
||||||
|
cookieContainer.SetCookies(new Uri(BaseUrl), c.Substring(0, c.LastIndexOf(';')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Cookie cookie in cookieContainer.GetCookies(new Uri(BaseUrl)))
|
||||||
|
{
|
||||||
|
if (cookie.Name == "session")
|
||||||
|
{
|
||||||
|
cookie.Expires = DateTime.Now.AddDays(360);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the home page now we are logged in as AllowAutoRedirect is false as we needed to get the cookie manually.
|
||||||
|
response = await client.GetAsync(BaseUrl);
|
||||||
|
responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
if (!responseContent.Contains("/user/logout"))
|
||||||
|
{
|
||||||
|
throw new ExceptionWithConfigData("Failed to login, 6 failed attempts will get you banned for 6 hours.", (ConfigurationData)config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AllowRaws = config.IncludeRaw.Value;
|
||||||
|
var configSaveData = new JObject();
|
||||||
|
cookieContainer.DumpToJson(SiteLink, configSaveData);
|
||||||
|
configSaveData["raws"] = AllowRaws;
|
||||||
|
|
||||||
|
if (OnSaveConfigurationRequested != null)
|
||||||
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
|
IsConfigured = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
|
{
|
||||||
|
cookieContainer.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
|
IsConfigured = true;
|
||||||
|
AllowRaws = jsonConfig["raws"].Value<bool>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string Hash(string input)
|
||||||
|
{
|
||||||
|
// Use input string to calculate MD5 hash
|
||||||
|
MD5 md5 = System.Security.Cryptography.MD5.Create();
|
||||||
|
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
|
||||||
|
byte[] hashBytes = md5.ComputeHash(inputBytes);
|
||||||
|
|
||||||
|
// Convert the byte array to hexadecimal string
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < hashBytes.Length; i++)
|
||||||
|
{
|
||||||
|
sb.Append(hashBytes[i].ToString("X2"));
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CleanCache()
|
||||||
|
{
|
||||||
|
foreach (var expired in cache.Where(i => i.Created - DateTime.Now > cacheTime).ToList())
|
||||||
|
{
|
||||||
|
cache.Remove(expired);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<ReleaseInfo[]> PerformQuery(TorznabQuery query)
|
||||||
|
{
|
||||||
|
// This tracker only deals with full seasons so chop off the episode/season number if we have it D:
|
||||||
|
if (!string.IsNullOrWhiteSpace(query.SearchTerm))
|
||||||
|
{
|
||||||
|
var splitindex = query.SearchTerm.LastIndexOf(' ');
|
||||||
|
if (splitindex > -1)
|
||||||
|
query.SearchTerm = query.SearchTerm.Substring(0, splitindex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The result list
|
||||||
|
var releases = new List<ReleaseInfo>();
|
||||||
|
|
||||||
|
// Check cache first so we don't query the server for each episode when searching for each episode in a series.
|
||||||
|
lock (cache)
|
||||||
|
{
|
||||||
|
// Remove old cache items
|
||||||
|
CleanCache();
|
||||||
|
|
||||||
|
var cachedResult = cache.Where(i => i.Query == query.SearchTerm).FirstOrDefault();
|
||||||
|
if (cachedResult != null)
|
||||||
|
return cachedResult.Results.Select(s => (ReleaseInfo)s.Clone()).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
var queryUrl = SearchUrl;
|
||||||
|
// Only include the query bit if its required as hopefully the site caches the non query page
|
||||||
|
if (!string.IsNullOrWhiteSpace(query.SearchTerm))
|
||||||
|
{
|
||||||
|
|
||||||
|
queryUrl += "&action=advanced&search_type=title&sort=time_added&way=desc&anime%5Btv_series%5D=1&searchstr=" + WebUtility.UrlEncode(query.SearchTerm);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the content from the tracker
|
||||||
|
var response = await client.GetAsync(queryUrl);
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
CQ dom = responseContent;
|
||||||
|
|
||||||
|
// Parse
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var releaseInfo = "S01";
|
||||||
|
var root = dom.Find(".anime");
|
||||||
|
// We may have got redirected to the series page if we have none of these
|
||||||
|
if (root.Count() == 0)
|
||||||
|
root = dom.Find(".torrent_table");
|
||||||
|
|
||||||
|
foreach (var series in root)
|
||||||
|
{
|
||||||
|
var seriesCq = series.Cq();
|
||||||
|
|
||||||
|
var synonyms = new List<string>();
|
||||||
|
var mainTitle = seriesCq.Find(".group_title strong a").First().Text().Trim();
|
||||||
|
|
||||||
|
var yearStr = seriesCq.Find(".group_title strong").First().Text().Trim().Replace("]", "").Trim();
|
||||||
|
int yearIndex = yearStr.LastIndexOf("[");
|
||||||
|
if (yearIndex > -1)
|
||||||
|
yearStr = yearStr.Substring(yearIndex + 1);
|
||||||
|
|
||||||
|
int year = 0;
|
||||||
|
if (!int.TryParse(yearStr, out year))
|
||||||
|
year = DateTime.Now.Year;
|
||||||
|
|
||||||
|
synonyms.Add(mainTitle);
|
||||||
|
|
||||||
|
// If the title contains a comma then we can't use the synonyms as they are comma seperated
|
||||||
|
if (!mainTitle.Contains(","))
|
||||||
|
{
|
||||||
|
var symnomnNames = string.Empty;
|
||||||
|
foreach (var e in seriesCq.Find(".group_statbox li"))
|
||||||
|
{
|
||||||
|
if (e.FirstChild.InnerText == "Synonyms:")
|
||||||
|
{
|
||||||
|
symnomnNames = e.InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(symnomnNames))
|
||||||
|
{
|
||||||
|
foreach (var name in symnomnNames.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
|
||||||
|
{
|
||||||
|
var theName = name.Trim();
|
||||||
|
if (!theName.Contains("&#") && !string.IsNullOrWhiteSpace(theName))
|
||||||
|
{
|
||||||
|
synonyms.Add(theName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var title in synonyms)
|
||||||
|
{
|
||||||
|
var releaseRows = seriesCq.Find(".torrent_group tr");
|
||||||
|
|
||||||
|
// Skip the first two info rows
|
||||||
|
for (int r = 2; r < releaseRows.Count(); r++)
|
||||||
|
{
|
||||||
|
var row = releaseRows.Get(r);
|
||||||
|
var rowCq = row.Cq();
|
||||||
|
if (rowCq.HasClass("edition_info"))
|
||||||
|
{
|
||||||
|
releaseInfo = rowCq.Find("td").Text();
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(releaseInfo))
|
||||||
|
{
|
||||||
|
// Single episodes alpha - Reported that this info is missing.
|
||||||
|
// It should self correct when availible
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
releaseInfo = releaseInfo.Replace("Episode ", "");
|
||||||
|
releaseInfo = releaseInfo.Replace("Season ", "S");
|
||||||
|
releaseInfo = releaseInfo.Trim();
|
||||||
|
}
|
||||||
|
else if (rowCq.HasClass("torrent"))
|
||||||
|
{
|
||||||
|
var links = rowCq.Find("a");
|
||||||
|
// Protect against format changes
|
||||||
|
if (links.Count() != 2)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var release = new ReleaseInfo();
|
||||||
|
release.MinimumRatio = 1;
|
||||||
|
release.MinimumSeedTime = 259200;
|
||||||
|
var downloadLink = links.Get(0);
|
||||||
|
release.Guid = new Uri(BaseUrl + "/" + downloadLink.Attributes.GetAttribute("href") + "&nh=" + Hash(title)); // Sonarr should dedupe on this url - allow a url per name.
|
||||||
|
release.Link = release.Guid;// We dont know this so try to fake based on the release year
|
||||||
|
release.PublishDate = new DateTime(year, 1, 1);
|
||||||
|
release.PublishDate = release.PublishDate.AddDays(Math.Min(DateTime.Now.DayOfYear, 365) - 1);
|
||||||
|
|
||||||
|
var infoLink = links.Get(1);
|
||||||
|
release.Comments = new Uri(BaseUrl + "/" + infoLink.Attributes.GetAttribute("href"));
|
||||||
|
|
||||||
|
// We dont actually have a release name >.> so try to create one
|
||||||
|
var releaseTags = infoLink.InnerText.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
|
for (int i = releaseTags.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
releaseTags[i] = releaseTags[i].Trim();
|
||||||
|
if (string.IsNullOrWhiteSpace(releaseTags[i]))
|
||||||
|
releaseTags.RemoveAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
var group = releaseTags.Last();
|
||||||
|
if (group.Contains("(") && group.Contains(")"))
|
||||||
|
{
|
||||||
|
// Skip raws if set
|
||||||
|
if (group.ToLowerInvariant().StartsWith("raw") && !AllowRaws)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var start = group.IndexOf("(");
|
||||||
|
group = "[" + group.Substring(start + 1, (group.IndexOf(")") - 1) - start) + "] ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
group = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var infoString = "";
|
||||||
|
|
||||||
|
for (int i = 0; i + 1 < releaseTags.Count(); i++)
|
||||||
|
{
|
||||||
|
infoString += "[" + releaseTags[i] + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
release.Title = string.Format("{0}{1} {2} {3}", group, title, releaseInfo, infoString);
|
||||||
|
release.Description = title;
|
||||||
|
|
||||||
|
var size = rowCq.Find(".torrent_size");
|
||||||
|
if (size.Count() > 0)
|
||||||
|
{
|
||||||
|
var sizeParts = size.First().Text().Split(' ');
|
||||||
|
release.Size = ReleaseInfo.GetBytes(sizeParts[1], ParseUtil.CoerceFloat(sizeParts[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Additional 5 hours per GB
|
||||||
|
release.MinimumSeedTime += (release.Size / 1000000000) * 18000;
|
||||||
|
|
||||||
|
// Peer info
|
||||||
|
release.Seeders = ParseUtil.CoerceInt(rowCq.Find(".torrent_seeders").Text());
|
||||||
|
release.Peers = release.Seeders + ParseUtil.CoerceInt(rowCq.Find(".torrent_leechers").Text());
|
||||||
|
|
||||||
|
releases.Add(release);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
OnResultParsingError(this, responseContent, ex);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Add to the cache
|
||||||
|
lock (cache)
|
||||||
|
{
|
||||||
|
cache.Add(new CachedResult(query.SearchTerm, releases));
|
||||||
|
}
|
||||||
|
|
||||||
|
return releases.Select(s => (ReleaseInfo)s.Clone()).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<byte[]> Download(Uri link)
|
||||||
|
{
|
||||||
|
return client.GetByteArrayAsync(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -86,7 +86,7 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -101,7 +101,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,15 +137,15 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
var dateString = qRow.Children().ElementAt(5).Cq().Text().Trim();
|
var dateString = qRow.Children().ElementAt(5).Cq().Text().Trim();
|
||||||
var pubDate = DateTime.ParseExact(dateString, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
var pubDate = DateTime.ParseExact(dateString, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
||||||
release.PublishDate = pubDate;
|
release.PublishDate = DateTime.SpecifyKind(pubDate, DateTimeKind.Local);
|
||||||
|
|
||||||
var sizeCol = qRow.Children().ElementAt(6);
|
var sizeCol = qRow.Children().ElementAt(6);
|
||||||
var sizeVal = sizeCol.ChildNodes[0].NodeValue;
|
var sizeVal = sizeCol.ChildNodes[0].NodeValue;
|
||||||
var sizeUnit = sizeCol.ChildNodes[2].NodeValue;
|
var sizeUnit = sizeCol.ChildNodes[2].NodeValue;
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeUnit, float.Parse(sizeVal));
|
release.Size = ReleaseInfo.GetBytes(sizeUnit, ParseUtil.CoerceFloat(sizeVal));
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Children().ElementAt(8).Cq().Text().Trim(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Children().ElementAt(8).Cq().Text().Trim());
|
||||||
release.Peers = int.Parse(qRow.Children().ElementAt(9).Cq().Text().Trim(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Children().ElementAt(9).Cq().Text().Trim()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -111,7 +111,7 @@ namespace Jackett
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -122,7 +122,7 @@ namespace Jackett
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,17 +163,18 @@ namespace Jackett
|
|||||||
var timeParts = new List<string>(timestamp.Replace(" at", "").Replace(",", "").Split(' '));
|
var timeParts = new List<string>(timestamp.Replace(" at", "").Replace(",", "").Split(' '));
|
||||||
timeParts[2] = Regex.Replace(timeParts[2], "[^0-9.]", "");
|
timeParts[2] = Regex.Replace(timeParts[2], "[^0-9.]", "");
|
||||||
var formattedTimeString = string.Join(" ", timeParts.ToArray()).Trim();
|
var formattedTimeString = string.Join(" ", timeParts.ToArray()).Trim();
|
||||||
release.PublishDate = DateTime.ParseExact(formattedTimeString, "dddd MMMM d yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
|
var date = DateTime.ParseExact(formattedTimeString, "dddd MMMM d yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
|
||||||
|
release.PublishDate = DateTime.SpecifyKind(date, DateTimeKind.Utc).ToLocalTime();
|
||||||
|
|
||||||
release.Link = new Uri(BaseUrl + "/" + row.ChildElements.ElementAt(2).Cq().Children("a.index").Attr("href"));
|
release.Link = new Uri(BaseUrl + "/" + row.ChildElements.ElementAt(2).Cq().Children("a.index").Attr("href"));
|
||||||
|
|
||||||
var sizeCol = row.ChildElements.ElementAt(6);
|
var sizeCol = row.ChildElements.ElementAt(6);
|
||||||
var sizeVal = float.Parse(sizeCol.ChildNodes[0].NodeValue);
|
var sizeVal = ParseUtil.CoerceFloat(sizeCol.ChildNodes[0].NodeValue);
|
||||||
var sizeUnit = sizeCol.ChildNodes[2].NodeValue;
|
var sizeUnit = sizeCol.ChildNodes[2].NodeValue;
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
||||||
|
|
||||||
release.Seeders = int.Parse(row.ChildElements.ElementAt(8).Cq().Text(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(row.ChildElements.ElementAt(8).Cq().Text());
|
||||||
release.Peers = int.Parse(row.ChildElements.ElementAt(9).Cq().Text(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(row.ChildElements.ElementAt(9).Cq().Text()) + release.Seeders;
|
||||||
|
|
||||||
//if (!release.Title.ToLower().Contains(title.ToLower()))
|
//if (!release.Title.ToLower().Contains(title.ToLower()))
|
||||||
// continue;
|
// continue;
|
||||||
|
@@ -90,7 +90,7 @@ namespace Jackett
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -101,7 +101,7 @@ namespace Jackett
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,11 +164,11 @@ namespace Jackett
|
|||||||
pubDate = DateTime.ParseExact(dateString, "d-MMM-yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToLocalTime();
|
pubDate = DateTime.ParseExact(dateString, "d-MMM-yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToLocalTime();
|
||||||
release.PublishDate = pubDate;
|
release.PublishDate = pubDate;
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Find("td.table_seeders").Text().Trim(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Find("td.table_seeders").Text().Trim());
|
||||||
release.Peers = int.Parse(qRow.Find("td.table_leechers").Text().Trim(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Find("td.table_leechers").Text().Trim()) + release.Seeders;
|
||||||
|
|
||||||
var sizeCol = qRow.Find("td.table_size")[0];
|
var sizeCol = qRow.Find("td.table_size")[0];
|
||||||
var sizeVal = float.Parse(sizeCol.ChildNodes[0].NodeValue.Trim());
|
var sizeVal = ParseUtil.CoerceFloat(sizeCol.ChildNodes[0].NodeValue.Trim());
|
||||||
var sizeUnit = sizeCol.ChildNodes[2].NodeValue.Trim();
|
var sizeUnit = sizeCol.ChildNodes[2].NodeValue.Trim();
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -110,7 +110,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(Newtonsoft.Json.Linq.JToken jsonConfig)
|
public void LoadFromSavedConfiguration(Newtonsoft.Json.Linq.JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ namespace Jackett.Indexers
|
|||||||
var descString = qRow.Find(".t_ctime").Text();
|
var descString = qRow.Find(".t_ctime").Text();
|
||||||
var dateString = descString.Split('|').Last().Trim();
|
var dateString = descString.Split('|').Last().Trim();
|
||||||
dateString = dateString.Split(new string[] { " by " }, StringSplitOptions.None)[0];
|
dateString = dateString.Split(new string[] { " by " }, StringSplitOptions.None)[0];
|
||||||
var dateValue = float.Parse(dateString.Split(' ')[0]);
|
var dateValue = ParseUtil.CoerceFloat(dateString.Split(' ')[0]);
|
||||||
var dateUnit = dateString.Split(' ')[1];
|
var dateUnit = dateString.Split(' ')[1];
|
||||||
if (dateUnit.Contains("minute"))
|
if (dateUnit.Contains("minute"))
|
||||||
pubDate = DateTime.Now - TimeSpan.FromMinutes(dateValue);
|
pubDate = DateTime.Now - TimeSpan.FromMinutes(dateValue);
|
||||||
@@ -173,12 +173,12 @@ namespace Jackett.Indexers
|
|||||||
release.Link = new Uri(BaseUrl + qLink.Attr("href"));
|
release.Link = new Uri(BaseUrl + qLink.Attr("href"));
|
||||||
|
|
||||||
var sizeStr = row.ChildElements.ElementAt(5).Cq().Text().Trim();
|
var sizeStr = row.ChildElements.ElementAt(5).Cq().Text().Trim();
|
||||||
var sizeVal = float.Parse(sizeStr.Split(' ')[0]);
|
var sizeVal = ParseUtil.CoerceFloat(sizeStr.Split(' ')[0]);
|
||||||
var sizeUnit = sizeStr.Split(' ')[1];
|
var sizeUnit = sizeStr.Split(' ')[1];
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Find(".t_seeders").Text().Trim(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Find(".t_seeders").Text().Trim());
|
||||||
release.Peers = int.Parse(qRow.Find(".t_leechers").Text().Trim(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Find(".t_leechers").Text().Trim()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -86,14 +86,16 @@ namespace Jackett.Indexers
|
|||||||
var content = new FormUrlEncodedContent(pairs);
|
var content = new FormUrlEncodedContent(pairs);
|
||||||
|
|
||||||
string responseContent;
|
string responseContent;
|
||||||
JArray cookieJArray;
|
|
||||||
|
var configSaveData = new JObject();
|
||||||
|
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
{
|
{
|
||||||
// If Windows use .net http
|
// If Windows use .net http
|
||||||
var response = await client.PostAsync(LoginUrl, content);
|
var response = await client.PostAsync(LoginUrl, content);
|
||||||
responseContent = await response.Content.ReadAsStringAsync();
|
responseContent = await response.Content.ReadAsStringAsync();
|
||||||
cookieJArray = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -101,7 +103,7 @@ namespace Jackett.Indexers
|
|||||||
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
||||||
responseContent = Encoding.UTF8.GetString(response.Content);
|
responseContent = Encoding.UTF8.GetString(response.Content);
|
||||||
cookieHeader = response.CookieHeader;
|
cookieHeader = response.CookieHeader;
|
||||||
cookieJArray = new JArray(response.CookiesFlat);
|
configSaveData["cookie_header"] = cookieHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!responseContent.Contains("logout.php?"))
|
if (!responseContent.Contains("logout.php?"))
|
||||||
@@ -114,9 +116,6 @@ namespace Jackett.Indexers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var configSaveData = new JObject();
|
|
||||||
configSaveData["cookies"] = cookieJArray;
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(SiteLink, (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(SiteLink, jsonConfig);
|
||||||
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
@@ -171,7 +170,10 @@ namespace Jackett.Indexers
|
|||||||
DateTime pubDate = DateTime.MinValue;
|
DateTime pubDate = DateTime.MinValue;
|
||||||
double dateNum;
|
double dateNum;
|
||||||
if (double.TryParse((string)r["groupTime"], out dateNum))
|
if (double.TryParse((string)r["groupTime"], out dateNum))
|
||||||
|
{
|
||||||
pubDate = UnixTimestampToDateTime(dateNum);
|
pubDate = UnixTimestampToDateTime(dateNum);
|
||||||
|
pubDate = DateTime.SpecifyKind(pubDate, DateTimeKind.Utc).ToLocalTime();
|
||||||
|
}
|
||||||
|
|
||||||
var groupName = (string)r["groupName"];
|
var groupName = (string)r["groupName"];
|
||||||
|
|
||||||
|
@@ -80,14 +80,14 @@ namespace Jackett.Indexers
|
|||||||
var content = new FormUrlEncodedContent(pairs);
|
var content = new FormUrlEncodedContent(pairs);
|
||||||
|
|
||||||
string responseContent;
|
string responseContent;
|
||||||
JArray cookieJArray;
|
var configSaveData = new JObject();
|
||||||
|
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
{
|
{
|
||||||
// If Windows use .net http
|
// If Windows use .net http
|
||||||
var response = await client.PostAsync(LoginUrl, content);
|
var response = await client.PostAsync(LoginUrl, content);
|
||||||
responseContent = await response.Content.ReadAsStringAsync();
|
responseContent = await response.Content.ReadAsStringAsync();
|
||||||
cookieJArray = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ namespace Jackett.Indexers
|
|||||||
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
var response = await CurlHelper.PostAsync(LoginUrl, pairs);
|
||||||
responseContent = Encoding.UTF8.GetString(response.Content);
|
responseContent = Encoding.UTF8.GetString(response.Content);
|
||||||
cookieHeader = response.CookieHeader;
|
cookieHeader = response.CookieHeader;
|
||||||
cookieJArray = new JArray(response.CookiesFlat);
|
configSaveData["cookie_header"] = cookieHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!responseContent.Contains("nav_profile"))
|
if (!responseContent.Contains("nav_profile"))
|
||||||
@@ -107,9 +107,6 @@ namespace Jackett.Indexers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
|
||||||
configSaveData["cookies"] = cookieJArray;
|
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
|
|
||||||
@@ -119,7 +116,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
cookieHeader = cookies.GetCookieHeader(SiteLink);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
@@ -166,7 +163,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
var sizeStr = qRow.Find(".ttr_size").Contents()[0].NodeValue;
|
var sizeStr = qRow.Find(".ttr_size").Contents()[0].NodeValue;
|
||||||
var sizeParts = sizeStr.Split(' ');
|
var sizeParts = sizeStr.Split(' ');
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeParts[1], float.Parse(sizeParts[0], NumberStyles.Float | NumberStyles.AllowThousands));
|
release.Size = ReleaseInfo.GetBytes(sizeParts[1], ParseUtil.CoerceFloat(sizeParts[0]));
|
||||||
|
|
||||||
var timeStr = qRow.Find(".ttr_added").Text();
|
var timeStr = qRow.Find(".ttr_added").Text();
|
||||||
DateTime time;
|
DateTime time;
|
||||||
@@ -175,8 +172,8 @@ namespace Jackett.Indexers
|
|||||||
release.PublishDate = time;
|
release.PublishDate = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Find(".ttr_seeders").Text(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Find(".ttr_seeders").Text());
|
||||||
release.Peers = int.Parse(qRow.Find(".ttr_leechers").Text(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Find(".ttr_leechers").Text()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,10 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
const string DefaultUrl = "https://getstrike.net";
|
const string DefaultUrl = "https://getstrike.net";
|
||||||
|
|
||||||
const string DownloadUrl = "/api/v2/torrents/download/?hash={0}";
|
|
||||||
|
//const string DownloadUrl = "/api/v2/torrents/download/?hash={0}";
|
||||||
|
const string DownloadUrl = "/torrents/api/download/{0}.torrent";
|
||||||
|
|
||||||
const string SearchUrl = "/api/v2/torrents/search/?category=TV&phrase={0}";
|
const string SearchUrl = "/api/v2/torrents/search/?category=TV&phrase={0}";
|
||||||
string BaseUrl;
|
string BaseUrl;
|
||||||
|
|
||||||
@@ -125,7 +128,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
release.InfoHash = (string)result["torrent_hash"];
|
release.InfoHash = (string)result["torrent_hash"];
|
||||||
release.MagnetUri = new Uri((string)result["magnet_uri"]);
|
release.MagnetUri = new Uri((string)result["magnet_uri"]);
|
||||||
release.Link = new Uri(string.Format("{0}{1}{2}", baseUrl, DownloadUrl, release.InfoHash));
|
release.Link = new Uri(string.Format("{0}{1}", baseUrl, string.Format(DownloadUrl, release.InfoHash)));
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -28,10 +28,9 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public bool IsConfigured { get; private set; }
|
public bool IsConfigured { get; private set; }
|
||||||
|
|
||||||
const string DefaultUrl = "https://thepiratebay.gd";
|
const string DefaultUrl = "https://thepiratebay.mn";
|
||||||
const string SearchUrl = "/s/?q=\"{0}\"&category=205&page=0&orderby=99";
|
const string SearchUrl = "/search/{0}/0/99/208";
|
||||||
const string SearchUrl2 = "/s/?q=\"{0}\"&category=208&page=0&orderby=99";
|
const string SearchUrl2 = "/search/{0}/0/99/205";
|
||||||
const string SwitchSingleViewUrl = "/switchview.php?view=s";
|
|
||||||
|
|
||||||
string BaseUrl;
|
string BaseUrl;
|
||||||
|
|
||||||
@@ -41,6 +40,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public ThePirateBay()
|
public ThePirateBay()
|
||||||
{
|
{
|
||||||
|
BaseUrl = DefaultUrl;
|
||||||
IsConfigured = false;
|
IsConfigured = false;
|
||||||
cookies = new CookieContainer();
|
cookies = new CookieContainer();
|
||||||
handler = new HttpClientHandler
|
handler = new HttpClientHandler
|
||||||
@@ -54,7 +54,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public Task<ConfigurationData> GetConfigurationForSetup()
|
public Task<ConfigurationData> GetConfigurationForSetup()
|
||||||
{
|
{
|
||||||
var config = new ConfigurationDataUrl(DefaultUrl);
|
var config = new ConfigurationDataUrl(BaseUrl);
|
||||||
return Task.FromResult<ConfigurationData>(config);
|
return Task.FromResult<ConfigurationData>(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,25 +108,19 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
foreach (var episodeSearchUrl in searchUrls)
|
foreach (var episodeSearchUrl in searchUrls)
|
||||||
{
|
{
|
||||||
var message = new HttpRequestMessage
|
|
||||||
{
|
|
||||||
Method = HttpMethod.Get,
|
|
||||||
RequestUri = new Uri(baseUrl + SwitchSingleViewUrl)
|
|
||||||
};
|
|
||||||
message.Headers.Referrer = new Uri(episodeSearchUrl);
|
|
||||||
|
|
||||||
string results;
|
string results;
|
||||||
|
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
{
|
{
|
||||||
var response = await client.SendAsync(message);
|
results = await client.GetStringAsync(episodeSearchUrl);
|
||||||
results = await response.Content.ReadAsStringAsync();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var response = await CurlHelper.GetAsync(baseUrl + SwitchSingleViewUrl, null, episodeSearchUrl);
|
var response = await CurlHelper.GetAsync(episodeSearchUrl, null, episodeSearchUrl);
|
||||||
results = Encoding.UTF8.GetString(response.Content);
|
results = Encoding.UTF8.GetString(response.Content);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CQ dom = results;
|
CQ dom = results;
|
||||||
@@ -136,7 +130,8 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
var release = new ReleaseInfo();
|
var release = new ReleaseInfo();
|
||||||
|
|
||||||
CQ qLink = row.ChildElements.ElementAt(1).Cq().Children("a").First();
|
CQ qRow = row.Cq();
|
||||||
|
CQ qLink = qRow.Find(".detName > .detLink").First();
|
||||||
|
|
||||||
release.MinimumRatio = 1;
|
release.MinimumRatio = 1;
|
||||||
release.MinimumSeedTime = 172800;
|
release.MinimumSeedTime = 172800;
|
||||||
@@ -145,13 +140,27 @@ namespace Jackett.Indexers
|
|||||||
release.Comments = new Uri(baseUrl + "/" + qLink.Attr("href").TrimStart('/'));
|
release.Comments = new Uri(baseUrl + "/" + qLink.Attr("href").TrimStart('/'));
|
||||||
release.Guid = release.Comments;
|
release.Guid = release.Comments;
|
||||||
|
|
||||||
var timeString = row.ChildElements.ElementAt(2).Cq().Text();
|
var downloadCol = row.ChildElements.ElementAt(1).Cq().Children("a");
|
||||||
|
release.MagnetUri = new Uri(downloadCol.Attr("href"));
|
||||||
|
release.InfoHash = release.MagnetUri.ToString().Split(':')[3].Split('&')[0];
|
||||||
|
|
||||||
|
var descString = qRow.Find(".detDesc").Text().Trim();
|
||||||
|
var descParts = descString.Split(',');
|
||||||
|
|
||||||
|
var timeString = descParts[0].Split(' ')[1];
|
||||||
|
|
||||||
if (timeString.Contains("mins ago"))
|
if (timeString.Contains("mins ago"))
|
||||||
release.PublishDate = (DateTime.Now - TimeSpan.FromMinutes(int.Parse(timeString.Split(' ')[0])));
|
{
|
||||||
|
release.PublishDate = (DateTime.Now - TimeSpan.FromMinutes(ParseUtil.CoerceInt(timeString.Split(' ')[0])));
|
||||||
|
}
|
||||||
else if (timeString.Contains("Today"))
|
else if (timeString.Contains("Today"))
|
||||||
|
{
|
||||||
release.PublishDate = (DateTime.UtcNow - TimeSpan.FromHours(2) - TimeSpan.Parse(timeString.Split(' ')[1])).ToLocalTime();
|
release.PublishDate = (DateTime.UtcNow - TimeSpan.FromHours(2) - TimeSpan.Parse(timeString.Split(' ')[1])).ToLocalTime();
|
||||||
|
}
|
||||||
else if (timeString.Contains("Y-day"))
|
else if (timeString.Contains("Y-day"))
|
||||||
|
{
|
||||||
release.PublishDate = (DateTime.UtcNow - TimeSpan.FromHours(26) - TimeSpan.Parse(timeString.Split(' ')[1])).ToLocalTime();
|
release.PublishDate = (DateTime.UtcNow - TimeSpan.FromHours(26) - TimeSpan.Parse(timeString.Split(' ')[1])).ToLocalTime();
|
||||||
|
}
|
||||||
else if (timeString.Contains(':'))
|
else if (timeString.Contains(':'))
|
||||||
{
|
{
|
||||||
var utc = DateTime.ParseExact(timeString, "MM-dd HH:mm", CultureInfo.InvariantCulture) - TimeSpan.FromHours(2);
|
var utc = DateTime.ParseExact(timeString, "MM-dd HH:mm", CultureInfo.InvariantCulture) - TimeSpan.FromHours(2);
|
||||||
@@ -163,17 +172,13 @@ namespace Jackett.Indexers
|
|||||||
release.PublishDate = DateTime.SpecifyKind(utc, DateTimeKind.Utc).ToLocalTime();
|
release.PublishDate = DateTime.SpecifyKind(utc, DateTimeKind.Utc).ToLocalTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
var downloadCol = row.ChildElements.ElementAt(3).Cq().Find("a");
|
var sizeParts = descParts[1].Split(new char[] { ' ', ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
release.MagnetUri = new Uri(downloadCol.Attr("href"));
|
var sizeVal = ParseUtil.CoerceFloat(sizeParts[1]);
|
||||||
release.InfoHash = release.MagnetUri.ToString().Split(':')[3].Split('&')[0];
|
var sizeUnit = sizeParts[2];
|
||||||
|
|
||||||
var sizeString = row.ChildElements.ElementAt(4).Cq().Text().Split(' ');
|
|
||||||
var sizeVal = float.Parse(sizeString[0], CultureInfo.InvariantCulture);
|
|
||||||
var sizeUnit = sizeString[1];
|
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
release.Size = ReleaseInfo.GetBytes(sizeUnit, sizeVal);
|
||||||
|
|
||||||
release.Seeders = int.Parse(row.ChildElements.ElementAt(5).Cq().Text());
|
release.Seeders = ParseUtil.CoerceInt(row.ChildElements.ElementAt(2).Cq().Text());
|
||||||
release.Peers = int.Parse(row.ChildElements.ElementAt(6).Cq().Text()) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(row.ChildElements.ElementAt(3).Cq().Text()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -107,7 +107,7 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -118,7 +118,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,11 +150,11 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
var sizeStr = qRow.Find(".sizeInfo").Text().Trim();
|
var sizeStr = qRow.Find(".sizeInfo").Text().Trim();
|
||||||
var sizeParts = sizeStr.Split(' ');
|
var sizeParts = sizeStr.Split(' ');
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeParts[1], float.Parse(sizeParts[0]));
|
release.Size = ReleaseInfo.GetBytes(sizeParts[1], ParseUtil.CoerceFloat(sizeParts[0]));
|
||||||
|
|
||||||
var dateStr = qRow.Find(".ulInfo").Text().Trim();
|
var dateStr = qRow.Find(".ulInfo").Text().Split('|').Last().Trim();
|
||||||
var dateParts = dateStr.Split(' ');
|
var dateParts = dateStr.Split(' ');
|
||||||
var dateValue = int.Parse(dateParts[1]);
|
var dateValue = ParseUtil.CoerceInt(dateParts[0]);
|
||||||
TimeSpan ts = TimeSpan.Zero;
|
TimeSpan ts = TimeSpan.Zero;
|
||||||
if (dateStr.Contains("sec"))
|
if (dateStr.Contains("sec"))
|
||||||
ts = TimeSpan.FromSeconds(dateValue);
|
ts = TimeSpan.FromSeconds(dateValue);
|
||||||
@@ -172,8 +172,8 @@ namespace Jackett.Indexers
|
|||||||
ts = TimeSpan.FromDays(dateValue * 365);
|
ts = TimeSpan.FromDays(dateValue * 365);
|
||||||
release.PublishDate = DateTime.Now - ts;
|
release.PublishDate = DateTime.Now - ts;
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Find(".seedersInfo").Text(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Find(".seedersInfo").Text());
|
||||||
release.Peers = int.Parse(qRow.Find(".leechersInfo").Text(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Find(".leechersInfo").Text()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -101,7 +101,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,10 +146,10 @@ namespace Jackett.Indexers
|
|||||||
release.PublishDate = DateTime.ParseExact(dateString, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
release.PublishDate = DateTime.ParseExact(dateString, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
var sizeStringParts = qRow.Children().ElementAt(4).InnerText.Split(' ');
|
var sizeStringParts = qRow.Children().ElementAt(4).InnerText.Split(' ');
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeStringParts[1], float.Parse(sizeStringParts[0]));
|
release.Size = ReleaseInfo.GetBytes(sizeStringParts[1], ParseUtil.CoerceFloat(sizeStringParts[0]));
|
||||||
|
|
||||||
release.Seeders = int.Parse(qRow.Find(".seeders").Text());
|
release.Seeders = ParseUtil.CoerceInt(qRow.Find(".seeders").Text());
|
||||||
release.Peers = int.Parse(qRow.Find(".leechers").Text());
|
release.Peers = release.Seeders + ParseUtil.CoerceInt(qRow.Find(".leechers").Text());
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -91,7 +91,7 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var configSaveData = new JObject();
|
var configSaveData = new JObject();
|
||||||
configSaveData["cookies"] = cookies.ToJson(SiteLink);
|
cookies.DumpToJson(SiteLink, configSaveData);
|
||||||
|
|
||||||
if (OnSaveConfigurationRequested != null)
|
if (OnSaveConfigurationRequested != null)
|
||||||
OnSaveConfigurationRequested(this, configSaveData);
|
OnSaveConfigurationRequested(this, configSaveData);
|
||||||
@@ -103,7 +103,7 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
public void LoadFromSavedConfiguration(JToken jsonConfig)
|
||||||
{
|
{
|
||||||
cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]);
|
cookies.FillFromJson(new Uri(BaseUrl), jsonConfig);
|
||||||
IsConfigured = true;
|
IsConfigured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,9 +139,11 @@ namespace Jackett.Indexers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var dateParts = dateStr.Split(' ');
|
var dateParts = dateStr.Split(' ');
|
||||||
var dateValue = int.Parse(dateParts[0]);
|
var dateValue = ParseUtil.CoerceInt(dateParts[0]);
|
||||||
TimeSpan ts = TimeSpan.Zero;
|
TimeSpan ts = TimeSpan.Zero;
|
||||||
if (dateStr.Contains("sec"))
|
if (dateStr.Contains("Just now"))
|
||||||
|
ts = TimeSpan.Zero;
|
||||||
|
else if (dateStr.Contains("sec"))
|
||||||
ts = TimeSpan.FromSeconds(dateValue);
|
ts = TimeSpan.FromSeconds(dateValue);
|
||||||
else if (dateStr.Contains("min"))
|
else if (dateStr.Contains("min"))
|
||||||
ts = TimeSpan.FromMinutes(dateValue);
|
ts = TimeSpan.FromMinutes(dateValue);
|
||||||
@@ -160,9 +162,9 @@ namespace Jackett.Indexers
|
|||||||
|
|
||||||
var sizeStr = qRow.Find(".size")[0].ChildNodes[0].NodeValue.Trim();
|
var sizeStr = qRow.Find(".size")[0].ChildNodes[0].NodeValue.Trim();
|
||||||
var sizeParts = sizeStr.Split(' ');
|
var sizeParts = sizeStr.Split(' ');
|
||||||
release.Size = ReleaseInfo.GetBytes(sizeParts[1], float.Parse(sizeParts[0], NumberStyles.AllowThousands));
|
release.Size = ReleaseInfo.GetBytes(sizeParts[1], ParseUtil.CoerceFloat(sizeParts[0]));
|
||||||
release.Seeders = int.Parse(qRow.Children().ElementAt(6).InnerText.Trim(), NumberStyles.AllowThousands);
|
release.Seeders = ParseUtil.CoerceInt(qRow.Children().ElementAt(6).InnerText.Trim());
|
||||||
release.Peers = int.Parse(qRow.Children().ElementAt(7).InnerText.Trim(), NumberStyles.AllowThousands) + release.Seeders;
|
release.Peers = ParseUtil.CoerceInt(qRow.Children().ElementAt(7).InnerText.Trim()) + release.Seeders;
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
@@ -232,13 +232,13 @@ namespace Jackett.Indexers
|
|||||||
switch (counter)
|
switch (counter)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
this.Size = ReleaseInfo.BytesFromMB(long.Parse(val.Substring(0, val.IndexOf(" ") - 1)));
|
this.Size = ReleaseInfo.BytesFromMB(ParseUtil.CoerceLong(val.Substring(0, val.IndexOf(" ") - 1)));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
this.Seeders = int.Parse(val.Contains(",") ? val.Remove(val.IndexOf(","), 1) : val);
|
this.Seeders = ParseUtil.CoerceInt(val.Contains(",") ? val.Remove(val.IndexOf(","), 1) : val);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.Peers = int.Parse(val.Contains(",") ? val.Remove(val.IndexOf(","), 1) : val);
|
this.Peers = ParseUtil.CoerceInt(val.Contains(",") ? val.Remove(val.IndexOf(","), 1) : val);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.hash = val;
|
this.hash = val;
|
||||||
|
@@ -57,11 +57,9 @@
|
|||||||
<Reference Include="CsQuery">
|
<Reference Include="CsQuery">
|
||||||
<HintPath>..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll</HintPath>
|
<HintPath>..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ModernHttpClient">
|
<Reference Include="NLog.Windows.Forms, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\modernhttpclient.2.3.0\lib\Portable-Net45+WinRT45+WP8+WPA81\ModernHttpClient.dll</HintPath>
|
<HintPath>..\packages\NLog.Windows.Forms.2.0.0.0\lib\net35\NLog.Windows.Forms.dll</HintPath>
|
||||||
</Reference>
|
<Private>True</Private>
|
||||||
<Reference Include="NLog">
|
|
||||||
<HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@@ -76,13 +74,18 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Newtonsoft.Json">
|
<Reference Include="Newtonsoft.Json">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NLog">
|
||||||
|
<HintPath>..\packages\NLog.4.0.1\lib\net45\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ApiKey.cs" />
|
<Compile Include="ApiKey.cs" />
|
||||||
|
<Compile Include="CachedResult.cs" />
|
||||||
<Compile Include="ChannelInfo.cs" />
|
<Compile Include="ChannelInfo.cs" />
|
||||||
<Compile Include="ConfigurationData.cs" />
|
<Compile Include="ConfigurationData.cs" />
|
||||||
|
<Compile Include="ConfigurationDataBasicLoginAnimeBytes.cs" />
|
||||||
<Compile Include="ConfigurationDataBasicLogin.cs" />
|
<Compile Include="ConfigurationDataBasicLogin.cs" />
|
||||||
<Compile Include="ConfigurationDataUrl.cs" />
|
<Compile Include="ConfigurationDataUrl.cs" />
|
||||||
<Compile Include="CookieContainerExtensions.cs" />
|
<Compile Include="CookieContainerExtensions.cs" />
|
||||||
@@ -102,6 +105,7 @@
|
|||||||
<Compile Include="Indexers\Strike.cs" />
|
<Compile Include="Indexers\Strike.cs" />
|
||||||
<Compile Include="Indexers\ThePirateBay.cs" />
|
<Compile Include="Indexers\ThePirateBay.cs" />
|
||||||
<Compile Include="Indexers\TorrentDay.cs" />
|
<Compile Include="Indexers\TorrentDay.cs" />
|
||||||
|
<Compile Include="Indexers\AnimeBytes.cs" />
|
||||||
<Compile Include="Indexers\TorrentLeech.cs" />
|
<Compile Include="Indexers\TorrentLeech.cs" />
|
||||||
<Compile Include="Indexers\TorrentShack.cs" />
|
<Compile Include="Indexers\TorrentShack.cs" />
|
||||||
<Compile Include="Indexers\Torrentz.cs" />
|
<Compile Include="Indexers\Torrentz.cs" />
|
||||||
@@ -111,6 +115,7 @@
|
|||||||
<Compile Include="Main.Designer.cs">
|
<Compile Include="Main.Designer.cs">
|
||||||
<DependentUpon>Main.cs</DependentUpon>
|
<DependentUpon>Main.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="ParseUtil.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
@@ -148,12 +153,21 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="WebContent\custom.css" />
|
<Content Include="WebContent\custom.css">
|
||||||
<Content Include="WebContent\custom.js" />
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="WebContent\custom.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="WebContent\logos\animebytes.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="WebContent\logos\sceneaccess.png">
|
<Content Include="WebContent\logos\sceneaccess.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="WebContent\logos\showrss.png" />
|
<Content Include="WebContent\logos\showrss.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="WebContent\logos\torrentday.png">
|
<Content Include="WebContent\logos\torrentday.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -227,7 +241,9 @@
|
|||||||
<Content Include="WebContent\logos\torrentleech.png">
|
<Content Include="WebContent\logos\torrentleech.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="WebContent\logos\torrentz.png" />
|
<Content Include="WebContent\logos\torrentz.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="WebContent\setup_indexer.html">
|
<Content Include="WebContent\setup_indexer.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -259,6 +275,17 @@
|
|||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<COMReference Include="IWshRuntimeLibrary">
|
||||||
|
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
|
||||||
|
<VersionMajor>1</VersionMajor>
|
||||||
|
<VersionMinor>0</VersionMinor>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<WrapperTool>tlbimp</WrapperTool>
|
||||||
|
<Isolated>False</Isolated>
|
||||||
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
|
</COMReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
@@ -267,4 +294,14 @@
|
|||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
|
<ProjectExtensions>
|
||||||
|
<MonoDevelop>
|
||||||
|
<Properties>
|
||||||
|
<Policies>
|
||||||
|
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||||
|
<CSharpFormattingPolicy IndentSwitchBody="True" IndentBlocksInsideExpressions="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="DoNotCare" ArrayInitializerWrapping="DoNotChange" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" NewLineBeforeConstructorInitializerColon="NewLine" NewLineAfterConstructorInitializerColon="SameLine" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||||
|
</Policies>
|
||||||
|
</Properties>
|
||||||
|
</MonoDevelop>
|
||||||
|
</ProjectExtensions>
|
||||||
</Project>
|
</Project>
|
7
src/Jackett/Main.Designer.cs
generated
7
src/Jackett/Main.Designer.cs
generated
@@ -1,4 +1,6 @@
|
|||||||
namespace Jackett
|
#if !__MonoCS__
|
||||||
|
|
||||||
|
namespace Jackett
|
||||||
{
|
{
|
||||||
partial class Main
|
partial class Main
|
||||||
{
|
{
|
||||||
@@ -97,4 +99,5 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemShutdown;
|
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemShutdown;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
@@ -1,10 +1,12 @@
|
|||||||
using Microsoft.Win32;
|
#if !__MonoCS__
|
||||||
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -57,20 +59,38 @@ namespace Jackett
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
return File.Exists(ShortcutPath);
|
||||||
if (rkApp.GetValue(ProgramTitle) == null)
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
|
||||||
if (value && !AutoStart)
|
if (value && !AutoStart)
|
||||||
rkApp.SetValue(ProgramTitle, Application.ExecutablePath.ToString());
|
{
|
||||||
|
CreateShortcut();
|
||||||
|
}
|
||||||
else if (!value && AutoStart)
|
else if (!value && AutoStart)
|
||||||
rkApp.DeleteValue(ProgramTitle, false);
|
{
|
||||||
|
File.Delete(ShortcutPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ShortcutPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Jackett.lnk");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateShortcut()
|
||||||
|
{
|
||||||
|
var appPath = Assembly.GetExecutingAssembly().Location;
|
||||||
|
var shell = new IWshRuntimeLibrary.WshShell();
|
||||||
|
var shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(ShortcutPath);
|
||||||
|
shortcut.Description = Assembly.GetExecutingAssembly().GetName().Name;
|
||||||
|
shortcut.TargetPath = appPath;
|
||||||
|
shortcut.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
28
src/Jackett/ParseUtil.cs
Normal file
28
src/Jackett/ParseUtil.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Jackett
|
||||||
|
{
|
||||||
|
public static class ParseUtil
|
||||||
|
{
|
||||||
|
public static float CoerceFloat(string str)
|
||||||
|
{
|
||||||
|
return float.Parse(str, NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int CoerceInt(string str)
|
||||||
|
{
|
||||||
|
return int.Parse(str, NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long CoerceLong(string str)
|
||||||
|
{
|
||||||
|
return long.Parse(str, NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Config;
|
using NLog.Config;
|
||||||
using NLog.Targets;
|
using NLog.Targets;
|
||||||
|
using NLog.Windows.Forms;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -18,7 +19,7 @@ namespace Jackett
|
|||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
public static string AppConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
public static string AppConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett");
|
||||||
|
|
||||||
public static Server ServerInstance { get; private set; }
|
public static Server ServerInstance { get; private set; }
|
||||||
|
|
||||||
@@ -36,6 +37,8 @@ namespace Jackett
|
|||||||
{
|
{
|
||||||
ExitEvent = new ManualResetEvent(false);
|
ExitEvent = new ManualResetEvent(false);
|
||||||
|
|
||||||
|
MigrateSettingsDirectory();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(AppConfigDirectory))
|
if (!Directory.Exists(AppConfigDirectory))
|
||||||
@@ -68,12 +71,14 @@ namespace Jackett
|
|||||||
|
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
{
|
{
|
||||||
|
#if !__MonoCS__
|
||||||
var logAlert = new MessageBoxTarget();
|
var logAlert = new MessageBoxTarget();
|
||||||
logConfig.AddTarget("alert", logAlert);
|
logConfig.AddTarget("alert", logAlert);
|
||||||
logAlert.Layout = "${message}";
|
logAlert.Layout = "${message}";
|
||||||
logAlert.Caption = "Alert";
|
logAlert.Caption = "Alert";
|
||||||
var logAlertRule = new LoggingRule("*", LogLevel.Fatal, logAlert);
|
var logAlertRule = new LoggingRule("*", LogLevel.Fatal, logAlert);
|
||||||
logConfig.LoggingRules.Add(logAlertRule);
|
logConfig.LoggingRules.Add(logAlertRule);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
var logConsole = new ConsoleTarget();
|
var logConsole = new ConsoleTarget();
|
||||||
@@ -96,7 +101,11 @@ namespace Jackett
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Program.IsWindows)
|
if (Program.IsWindows)
|
||||||
|
{
|
||||||
|
#if !__MonoCS__
|
||||||
Application.Run(new Main());
|
Application.Run(new Main());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -111,6 +120,22 @@ namespace Jackett
|
|||||||
Console.WriteLine("Server thread exit");
|
Console.WriteLine("Server thread exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void MigrateSettingsDirectory()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
||||||
|
if (Directory.Exists(oldDir) && !Directory.Exists(AppConfigDirectory))
|
||||||
|
{
|
||||||
|
Directory.Move(oldDir, AppConfigDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("ERROR could not migrate settings directory " + ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ReadSettingsFile()
|
static void ReadSettingsFile()
|
||||||
{
|
{
|
||||||
var path = Path.Combine(AppConfigDirectory, "config.json");
|
var path = Path.Combine(AppConfigDirectory, "config.json");
|
||||||
|
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("0.4.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Jackett
|
namespace Jackett
|
||||||
{
|
{
|
||||||
|
|
||||||
public class ReleaseInfo
|
public class ReleaseInfo: ICloneable
|
||||||
{
|
{
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public Uri Guid { get; set; }
|
public Uri Guid { get; set; }
|
||||||
@@ -28,6 +28,30 @@ namespace Jackett
|
|||||||
public double? MinimumRatio { get; set; }
|
public double? MinimumRatio { get; set; }
|
||||||
public long? MinimumSeedTime { get; set; }
|
public long? MinimumSeedTime { get; set; }
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
return new ReleaseInfo()
|
||||||
|
{
|
||||||
|
Title = Title,
|
||||||
|
Guid = Guid,
|
||||||
|
Link = Link,
|
||||||
|
Comments = Comments,
|
||||||
|
PublishDate = PublishDate,
|
||||||
|
Category = Category,
|
||||||
|
Size = Size,
|
||||||
|
Description = Description,
|
||||||
|
RageID = RageID,
|
||||||
|
Imdb = Imdb,
|
||||||
|
Seeders = Seeders,
|
||||||
|
Peers = Peers,
|
||||||
|
ConverUrl = ConverUrl,
|
||||||
|
BannerUrl = BannerUrl,
|
||||||
|
InfoHash = InfoHash,
|
||||||
|
MagnetUri = MagnetUri,
|
||||||
|
MinimumRatio = MinimumRatio,
|
||||||
|
MinimumSeedTime = MinimumSeedTime
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static long GetBytes(string unit, float value)
|
public static long GetBytes(string unit, float value)
|
||||||
{
|
{
|
||||||
|
@@ -86,7 +86,15 @@ namespace Jackett
|
|||||||
|
|
||||||
string SanitizeTitle(string title)
|
string SanitizeTitle(string title)
|
||||||
{
|
{
|
||||||
return title.Replace("(", "").Replace(")", "");
|
char[] arr = title.ToCharArray();
|
||||||
|
|
||||||
|
arr = Array.FindAll<char>(arr, c => (char.IsLetterOrDigit(c)
|
||||||
|
|| char.IsWhiteSpace(c)
|
||||||
|
|| c == '-'
|
||||||
|
|| c == '.'
|
||||||
|
));
|
||||||
|
title = new string(arr);
|
||||||
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadSettings()
|
void LoadSettings()
|
||||||
@@ -129,9 +137,9 @@ namespace Jackett
|
|||||||
{
|
{
|
||||||
var config = new ConfigurationSonarr();
|
var config = new ConfigurationSonarr();
|
||||||
config.LoadValuesFromJson(configJson);
|
config.LoadValuesFromJson(configJson);
|
||||||
await ReloadNameMappings(config.Host.Value, int.Parse(config.Port.Value), config.ApiKey.Value);
|
await ReloadNameMappings(config.Host.Value, ParseUtil.CoerceInt(config.Port.Value), config.ApiKey.Value);
|
||||||
Host = "http://" + new Uri(config.Host.Value).Host;
|
Host = "http://" + new Uri(config.Host.Value).Host;
|
||||||
Port = int.Parse(config.Port.Value);
|
Port = ParseUtil.CoerceInt(config.Port.Value);
|
||||||
ApiKey = config.ApiKey.Value;
|
ApiKey = config.ApiKey.Value;
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ namespace Jackett
|
|||||||
else if (string.IsNullOrEmpty(Episode))
|
else if (string.IsNullOrEmpty(Episode))
|
||||||
episodeString = string.Format("S{0:00}", Season);
|
episodeString = string.Format("S{0:00}", Season);
|
||||||
else
|
else
|
||||||
episodeString = string.Format("S{0:00}E{1:00}", Season, int.Parse(Episode));
|
episodeString = string.Format("S{0:00}E{1:00}", Season, ParseUtil.CoerceInt(Episode));
|
||||||
|
|
||||||
return episodeString;
|
return episodeString;
|
||||||
}
|
}
|
||||||
@@ -46,11 +46,24 @@ namespace Jackett
|
|||||||
var q = new TorznabQuery();
|
var q = new TorznabQuery();
|
||||||
q.QueryType = query["t"];
|
q.QueryType = query["t"];
|
||||||
q.SearchTerm = query["q"];
|
q.SearchTerm = query["q"];
|
||||||
q.Categories = query["cat"].Split(',');
|
if (query["cat"] != null)
|
||||||
q.Extended = int.Parse(query["extended"]);
|
{
|
||||||
|
q.Categories = query["cat"].Split(',');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query["extended"] != null)
|
||||||
|
{
|
||||||
|
q.Extended = ParseUtil.CoerceInt(query["extended"]);
|
||||||
|
}
|
||||||
q.ApiKey = query["apikey"];
|
q.ApiKey = query["apikey"];
|
||||||
q.Limit = int.Parse(query["limit"]);
|
if (query["limit"] != null)
|
||||||
q.Offset = int.Parse(query["offset"]);
|
{
|
||||||
|
q.Limit = ParseUtil.CoerceInt(query["limit"]);
|
||||||
|
}
|
||||||
|
if (query["offset"] != null)
|
||||||
|
{
|
||||||
|
q.Offset = ParseUtil.CoerceInt(query["offset"]);
|
||||||
|
}
|
||||||
|
|
||||||
int temp;
|
int temp;
|
||||||
if (int.TryParse(query["rid"], out temp))
|
if (int.TryParse(query["rid"], out temp))
|
||||||
|
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -257,6 +258,7 @@ namespace Jackett
|
|||||||
{
|
{
|
||||||
jsonReply["result"] = "success";
|
jsonReply["result"] = "success";
|
||||||
jsonReply["api_key"] = ApiKey.CurrentKey;
|
jsonReply["api_key"] = ApiKey.CurrentKey;
|
||||||
|
jsonReply["app_version"] = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
JArray items = new JArray();
|
JArray items = new JArray();
|
||||||
foreach (var i in indexerManager.Indexers)
|
foreach (var i in indexerManager.Indexers)
|
||||||
{
|
{
|
||||||
|
@@ -1,178 +1,190 @@
|
|||||||
body {
|
body {
|
||||||
background-image: url("binding_dark.png");
|
background-image: url("binding_dark.png");
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
margin-bottom: 100px;
|
margin-bottom: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-fluid {
|
.container-fluid {
|
||||||
}
|
}
|
||||||
|
|
||||||
#templates {
|
#templates {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 1px 1px 5px 2px #cdcdcd;
|
box-shadow: 1px 1px 5px 2px #cdcdcd;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width: 260px;
|
width: 260px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unconfigured-indexer {
|
.unconfigured-indexer {
|
||||||
height: 170px;
|
height: 170px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer {
|
.indexer {
|
||||||
height: 230px;
|
height: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-indexer {
|
.add-indexer {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-logo {
|
.indexer-logo {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-logo > img {
|
.indexer-logo > img {
|
||||||
border: 1px solid #828282;
|
border: 1px solid #828282;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-name > h3 {
|
.indexer-name > h3 {
|
||||||
margin-top: 13px;
|
margin-top: 13px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-buttons {
|
.indexer-buttons {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-buttons > .btn {
|
.indexer-buttons > .btn {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.indexer-button-test {
|
.indexer-button-test {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-add-content {
|
.indexer-add-content {
|
||||||
color: gray;
|
color: gray;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-add-content > .glyphicon {
|
.indexer-add-content > .glyphicon {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexer-add-content > .light-text {
|
.indexer-add-content > .light-text {
|
||||||
margin-top: 11px;
|
margin-top: 11px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
margin-left: -5px;
|
margin-left: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.indexer-host > input {
|
.indexer-host > input {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setup-item-inputstring {
|
.setup-item-inputstring {
|
||||||
max-width: 260px;
|
max-width: 260px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spinner {
|
.setup-item-inputbool input {
|
||||||
-webkit-animation: spin 2s infinite linear;
|
max-width: 100px;
|
||||||
-moz-animation: spin 2s infinite linear;
|
height: 20px;
|
||||||
-o-animation: spin 2s infinite linear;
|
}
|
||||||
animation: spin 2s infinite linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-moz-keyframes spin {
|
.spinner {
|
||||||
from {
|
-webkit-animation: spin 2s infinite linear;
|
||||||
-moz-transform: rotate(0deg);
|
-moz-animation: spin 2s infinite linear;
|
||||||
}
|
-o-animation: spin 2s infinite linear;
|
||||||
|
animation: spin 2s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
to {
|
@-moz-keyframes spin {
|
||||||
-moz-transform: rotate(360deg);
|
from {
|
||||||
}
|
-moz-transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes spin {
|
to {
|
||||||
from {
|
-moz-transform: rotate(360deg);
|
||||||
-webkit-transform: rotate(0deg);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
@-webkit-keyframes spin {
|
||||||
-webkit-transform: rotate(360deg);
|
from {
|
||||||
}
|
-webkit-transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes spin {
|
to {
|
||||||
from {
|
-webkit-transform: rotate(360deg);
|
||||||
transform: rotate(0deg);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
@keyframes spin {
|
||||||
transform: rotate(360deg);
|
from {
|
||||||
}
|
transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#setup-indexer-go {
|
to {
|
||||||
width: 70px;
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hr {
|
#setup-indexer-go {
|
||||||
border-top-color: #cdcdcd;
|
width: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-area {
|
hr {
|
||||||
}
|
border-top-color: #cdcdcd;
|
||||||
|
}
|
||||||
|
|
||||||
.input-area > * {
|
.input-area {
|
||||||
vertical-align: middle;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.input-area > p {
|
.input-area > * {
|
||||||
margin-top: 10px;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-header {
|
.input-area > p {
|
||||||
font-size: 18px;
|
margin-top: 10px;
|
||||||
width: 140px;
|
}
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-right {
|
.input-header {
|
||||||
width: 300px;
|
font-size: 18px;
|
||||||
display: inline-block;
|
width: 140px;
|
||||||
font-family: monospace;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sonarr-warning {
|
.input-right {
|
||||||
display: none;
|
width: 300px;
|
||||||
}
|
display: inline-block;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
#logo {
|
#sonarr-warning {
|
||||||
max-width: 50px;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header-title {
|
#logo {
|
||||||
font-size: 34px;
|
max-width: 50px;
|
||||||
vertical-align: middle;
|
}
|
||||||
padding-left: 15px;
|
|
||||||
}
|
#header-title {
|
||||||
|
font-size: 34px;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
color: #444444;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
@@ -89,6 +89,7 @@ function reloadIndexers() {
|
|||||||
$('#unconfigured-indexers').empty();
|
$('#unconfigured-indexers').empty();
|
||||||
var jqxhr = $.get("get_indexers", function (data) {
|
var jqxhr = $.get("get_indexers", function (data) {
|
||||||
$("#api-key-input").val(data.api_key);
|
$("#api-key-input").val(data.api_key);
|
||||||
|
$("#app-version").html(data.app_version);
|
||||||
displayIndexers(data.items);
|
displayIndexers(data.items);
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
doNotify("Error loading indexers, request to Jackett server failed", "danger", "glyphicon glyphicon-alert");
|
doNotify("Error loading indexers, request to Jackett server failed", "danger", "glyphicon glyphicon-alert");
|
||||||
@@ -219,7 +220,7 @@ function getConfigModalJson(configForm) {
|
|||||||
configJson[id] = $el.find(".setup-item-inputstring").val();
|
configJson[id] = $el.find(".setup-item-inputstring").val();
|
||||||
break;
|
break;
|
||||||
case "inputbool":
|
case "inputbool":
|
||||||
configJson[id] = $el.find(".setup-item-checkbox").val();
|
configJson[id] = $el.find(".setup-item-inputbool input").is(":checked");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -56,6 +56,13 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div id="footer">
|
||||||
|
Jackett Version <span id="app-version"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="select-indexer-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
<div id="select-indexer-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
@@ -113,7 +120,7 @@
|
|||||||
<div class="indexer-logo"><img src="logos/{{id}}.png" /></div>
|
<div class="indexer-logo"><img src="logos/{{id}}.png" /></div>
|
||||||
<div class="indexer-name"><h3>{{name}}</h3></div>
|
<div class="indexer-name"><h3>{{name}}</h3></div>
|
||||||
<div class="indexer-buttons">
|
<div class="indexer-buttons">
|
||||||
<button class="btn btn-primary btn-sm indexer-setup" data-id="{{id}}">
|
<button class="btn btn-primary btn-sm indexer-setup" data-id="{{id}}">
|
||||||
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger btn-sm indexer-button-delete" data-id="{{id}}">
|
<button class="btn btn-danger btn-sm indexer-button-delete" data-id="{{id}}">
|
||||||
@@ -148,11 +155,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input class="setup-item-inputstring form-control" type="text" value="{{{value}}}" />
|
<input class="setup-item-inputstring form-control" type="text" value="{{{value}}}" />
|
||||||
<div class="setup-item-checkbox">
|
<div class="setup-item-inputbool">
|
||||||
{{#if value}}
|
{{#if value}}
|
||||||
<input type="checkbox" class="form-control" checked />
|
<input type="checkbox" data-id="{{id}}" class="form-control" checked />
|
||||||
{{else}}
|
{{else}}
|
||||||
<input type="checkbox" class="form-control" />
|
<input type="checkbox" data-id="{{id}}" class="form-control" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<img class="setup-item-displayimage" src="{{{value}}}" />
|
<img class="setup-item-displayimage" src="{{{value}}}" />
|
||||||
@@ -160,8 +167,10 @@
|
|||||||
|
|
||||||
<span class="spinner glyphicon glyphicon-refresh"></span>
|
<span class="spinner glyphicon glyphicon-refresh"></span>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script src="custom.js"></script>
|
<script src="custom.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
BIN
src/Jackett/WebContent/logos/animebytes.png
Normal file
BIN
src/Jackett/WebContent/logos/animebytes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="CsQuery" version="1.3.4" targetFramework="net451" />
|
<package id="CsQuery" version="1.3.4" targetFramework="net451" />
|
||||||
<package id="modernhttpclient" version="2.3.0" targetFramework="net451" />
|
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
|
||||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
|
<package id="NLog" version="4.0.1" targetFramework="net451" />
|
||||||
<package id="NLog" version="3.2.0.0" targetFramework="net451" />
|
<package id="NLog.Windows.Forms" version="2.0.0.0" targetFramework="net451" />
|
||||||
</packages>
|
</packages>
|
Reference in New Issue
Block a user