Cardigann enhancements (#728)

* Cardigann: Use GET for landing site request

* Cardigann: Add support for magnet links
This commit is contained in:
kaso17 2016-11-24 08:31:39 +01:00 committed by GitHub
parent dcc3f2df63
commit 23c13969ae
1 changed files with 10 additions and 2 deletions

View File

@ -333,7 +333,7 @@ namespace Jackett.Indexers
var pairs = new Dictionary<string, string>(); var pairs = new Dictionary<string, string>();
configData.CookieHeader.Value = null; configData.CookieHeader.Value = null;
var landingResult = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, false, null, SiteLink, true); var landingResult = await RequestStringWithCookies(LoginUrl, null, SiteLink);
var htmlParser = new HtmlParser(); var htmlParser = new HtmlParser();
var landingResultDocument = htmlParser.Parse(landingResult.Content); var landingResultDocument = htmlParser.Parse(landingResult.Content);
@ -692,7 +692,15 @@ namespace Jackett.Indexers
switch (Field.Key) switch (Field.Key)
{ {
case "download": case "download":
release.Link = resolvePath(value); if (value.StartsWith("magnet:"))
{
release.MagnetUri = new Uri(value);
release.Link = release.MagnetUri;
}
else
{
release.Link = resolvePath(value);
}
break; break;
case "details": case "details":
var url = resolvePath(value); var url = resolvePath(value);