Merge branch 'master' into dotnetcore

This commit is contained in:
flightlevel
2018-06-10 12:53:02 +10:00
8 changed files with 30 additions and 11 deletions

View File

@@ -28,7 +28,7 @@
search: search:
paths: paths:
- path: "list/{{if .Keywords}}{{.Keywords}}{{else}}movie{{end}}.html" - path: "list/{{if .Keywords}}{{.Keywords}}{{else}}movie/1-1-0{{end}}.html"
rows: rows:
selector: .rs selector: .rs
fields: fields:

View File

@@ -69,6 +69,8 @@
inputs: inputs:
$raw: "{{range .Categories}}c{{.}}=1&{{end}}" $raw: "{{range .Categories}}c{{.}}=1&{{end}}"
search: "{{ .Keywords }}" search: "{{ .Keywords }}"
sort: "id"
order: "desc"
incldead: "1" incldead: "1"
keywordsfilters: keywordsfilters:
- name: replace - name: replace

View File

@@ -7,6 +7,8 @@
encoding: UTF-8 encoding: UTF-8
links: links:
- http://shareisland.org/ - http://shareisland.org/
legacylinks:
- http://www.shareisland.org/
caps: caps:
categorymappings: categorymappings:
@@ -25,6 +27,7 @@
- {id: 41, cat: Books, desc: "Quotidiani"} - {id: 41, cat: Books, desc: "Quotidiani"}
- {id: 59, cat: Books, desc: "Fumetti"} - {id: 59, cat: Books, desc: "Fumetti"}
- {id: 60, cat: Books, desc: "Riviste"} - {id: 60, cat: Books, desc: "Riviste"}
- {id: 61, cat: Books, desc: "Audiolibri"}
# Games # Games
- {id: 47, cat: PC/Games, desc: "Games PC"} - {id: 47, cat: PC/Games, desc: "Games PC"}
- {id: 22, cat: Console/Other, desc: "Nintendo"} - {id: 22, cat: Console/Other, desc: "Nintendo"}

View File

@@ -262,7 +262,6 @@ namespace Jackett.Common.Indexers
string groupTitle = null; string groupTitle = null;
string groupYearStr = null; string groupYearStr = null;
var categoryStr = ""; var categoryStr = "";
DateTime? groupPublishDate = null;
foreach (var row in rows) foreach (var row in rows)
{ {

View File

@@ -193,7 +193,7 @@ namespace Jackett.Common.Indexers
if (!isWindows && dotNetVersion.Major < 4) if (!isWindows && dotNetVersion.Major < 4)
{ {
// User isn't running Windows, but is running on .NET Core framewrok, no access to the DPAPI, so don't bother trying to migrate // User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
return false; return false;
} }
@@ -223,7 +223,12 @@ namespace Jackett.Common.Indexers
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.Info("Password could not be unprotected using Microsoft.AspNetCore.DataProtection, trying legacy: " + ex.ToString()); if (ex.Message != "The provided payload cannot be decrypted because it was not protected with this protection provider.")
{
logger.Info($"Password could not be unprotected using Microsoft.AspNetCore.DataProtection - {ID} : " + ex);
}
logger.Info($"Attempting legacy Unprotect - {ID} : ");
try try
{ {
@@ -234,11 +239,13 @@ namespace Jackett.Common.Indexers
SaveConfig(); SaveConfig();
IsConfigured = true; IsConfigured = true;
logger.Info($"Password successfully migrated for {ID}");
return true; return true;
} }
catch (Exception exception) catch (Exception exception)
{ {
logger.Info("Password could not be unprotected using legacy DPAPI: " + exception.ToString()); logger.Info($"Password could not be unprotected using legacy DPAPI - {ID} : " + exception);
} }
} }
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@@ -167,7 +168,7 @@ namespace Jackett.Common.Indexers
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query) protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{ {
Dictionary<string, string> qParams = new Dictionary<string, string>(); var qParams = new NameValueCollection();
qParams.Add("cata", "yes"); qParams.Add("cata", "yes");
qParams.Add("sec", "jax"); qParams.Add("sec", "jax");
@@ -182,7 +183,9 @@ namespace Jackett.Common.Indexers
qParams.Add("search", query.GetQueryString()); qParams.Add("search", query.GetQueryString());
} }
var results = await PostDataWithCookiesAndRetry(SearchUrl, qParams); var searchUrl = SearchUrl + "?" + qParams.GetQueryString();
var results = await RequestStringWithCookies(searchUrl);
List<ReleaseInfo> releases = ParseResponse(query, results.Content); List<ReleaseInfo> releases = ParseResponse(query, results.Content);
return releases; return releases;

View File

@@ -467,8 +467,13 @@ namespace Jackett.Controllers
var link = result.Link; var link = result.Link;
var file = StringUtil.MakeValidFileName(result.Title, '_', false); var file = StringUtil.MakeValidFileName(result.Title, '_', false);
result.Link = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "dl", file); result.Link = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "dl", file);
if (result.Link != null && result.Link.Scheme != "magnet" && !string.IsNullOrWhiteSpace(Engine.ServerConfig.BlackholeDir)) if (!string.IsNullOrWhiteSpace(Engine.ServerConfig.BlackholeDir))
{
if (result.Link != null)
result.BlackholeLink = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "bh", file); result.BlackholeLink = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "bh", file);
else if (result.MagnetUri != null)
result.BlackholeLink = serverService.ConvertToProxyLink(result.MagnetUri, serverUrl, result.TrackerId, "bh", file);
}
} }
} }

View File

@@ -61,7 +61,7 @@ namespace Jackett.Services
public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "t") public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "t")
{ {
if (link == null || (link.IsAbsoluteUri && link.Scheme == "magnet")) if (link == null || (link.IsAbsoluteUri && link.Scheme == "magnet" && action != "bh")) // no need to convert a magnet link to a proxy link unless it's a blackhole link
return link; return link;
var encryptedLink = _protectionService.Protect(link.ToString()); var encryptedLink = _protectionService.Protect(link.ToString());