Compare commits

...

11 Commits

Author SHA1 Message Date
flightlevel
0fc3d224ab Allow Custom Data Folder (#355)
Allow Custom Data Folder
2016-05-28 19:40:55 +10:00
flightlevel
ac07cc34cd SpeedCD: Fix Login (#354)
SpeedCD: Fix Login
2016-05-28 19:40:39 +10:00
flightlevel
3730e05f20 TorrentDay: Add Audio (#353)
TorrentDay: Add Audio
2016-05-28 19:40:16 +10:00
flightlevel
2644fd813e Bluetigers fix SSL issue (#346) 2016-05-18 20:33:37 +10:00
flightlevel
ece16d1075 TransmitheNet: Fix Titles with extension (#343) 2016-05-17 23:25:26 +10:00
Fredrik Löwenhamn
3b13fa84a4 Fixed saving alphaRatio json (#342) 2016-05-17 23:04:15 +10:00
flightlevel
cda5ea3207 Update README.md 2016-05-14 22:44:49 +10:00
flightlevel
0746616b43 Revert "SSL Fix by default, Now use TLS (1.2, 1.1, 1) by default" (#339) 2016-05-14 22:42:16 +10:00
JigSaw
28199ab4be SSL Fix by default, Added support of TLS 1.1 & 1.2 (#337)
* SSL Fix by default, Now use TLS (1.2, 1.1, 1) by default
* Workaround to use TLS 1.2 & 1.1 on Mono < 4.3
2016-05-14 00:46:56 +02:00
JigSaw
b29c578adb Fixed FADN Provider (#336)
New Search Engine Template
2016-05-13 23:41:10 +02:00
smarshallsay
b42f2a0972 Deal with carriage return in date string (#325) 2016-04-30 21:48:52 +10:00
12 changed files with 78 additions and 36 deletions

View File

@@ -56,6 +56,7 @@ Developer note: The software implements the [Torznab](https://github.com/Sonarr/
* TorrentDay
* TorrentLeech
* TorrentShack
* TransmitheNet
* TV Chaos UK
* World-In-HD
* XSpeeds

View File

@@ -60,6 +60,9 @@ namespace Jackett.Console
[Option('n', "IgnoreSslErrors", HelpText = "[true/false] Linux Libcurl - Ignores invalid SSL certificates")]
public bool? IgnoreSslErrors { get; set; }
[Option('d', "DataFolder", HelpText = "Specify the location of the data folder (Must be admin on Windows) eg. --DataFolder=\"D:\\Your Data\\Jackett\\\"")]
public string DataFolder { get; set; }
[ParserState]
public IParserState LastParserState { get; set; }
}

View File

@@ -99,6 +99,13 @@ namespace JackettConsole
Engine.Logger.Info("Curl will ignore SSL certificate errors.");
}
// Choose Data Folder
if (!string.IsNullOrWhiteSpace(options.DataFolder))
{
Startup.CustomDataFolder = options.DataFolder.Replace("\"", string.Empty).Replace("'", string.Empty).Replace(@"\\", @"\");
Engine.Logger.Info("Jackett Data will be stored in: " + Startup.CustomDataFolder);
}
/* ====== Actions ===== */
// Install service

View File

@@ -56,13 +56,18 @@ namespace Jackett.Indexers
AddCategoryMapping(23, TorznabCatType.Audio);
}
new ConfigurationDataBasicLogin configData
{
get { return (ConfigurationDataBasicLogin)base.configData; }
set { base.configData = value; }
}
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{
var incomingConfig = new ConfigurationDataBasicLogin();
incomingConfig.LoadValuesFromJson(configJson);
configData.LoadValuesFromJson(configJson);
var pairs = new Dictionary<string, string> {
{ "username", incomingConfig.Username.Value },
{ "password", incomingConfig.Password.Value },
{ "username", configData.Username.Value },
{ "password", configData.Password.Value },
{ "login", "Login" },
{ "keeplogged", "1" }
};
@@ -74,7 +79,7 @@ namespace Jackett.Indexers
CQ dom = response.Content;
dom["#loginform > table"].Remove();
var errorMessage = dom["#loginform"].Text().Trim().Replace("\n\t", " ");
throw new ExceptionWithConfigData(errorMessage, (ConfigurationData)incomingConfig);
throw new ExceptionWithConfigData(errorMessage, configData);
});
return IndexerConfigurationStatus.RequiresTesting;
}

View File

@@ -392,16 +392,8 @@ namespace Jackett.Indexers
var id = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(1) > div:first > a").Attr("name"), @"\d+").Value);
Output("ID: " + id);
// Check if torrent is not nuked by tracker or rulez, can't download it
if (tRow.Find("td:eq(2) > a").Length == 0)
{
// Next item
Output("Torrent is nuked, we can't download it, going to next torrent...");
continue;
}
// Release Name
var name = tRow.Find("td:eq(2) > a").Attr("title").Substring(24).Trim();
// Release Name -- Can be truncated ... Need FIX on tracker's side !
var name = tRow.Find("td:eq(1) > div > a:eq(2)").Text().Trim();
Output("Release: " + name);
// Category
@@ -410,35 +402,31 @@ namespace Jackett.Indexers
Output("Category: " + MapTrackerCatToNewznab(categoryId.ToString()) + " (" + categoryId + " - " + categoryName + ")");
// Seeders
var seeders = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(5) > div > font").Select(s => Regex.Replace(s.ToString(), "<.*?>", string.Empty)).ToString(), @"\d+").Value);
var seeders = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(4) > div > font > a").Text(), @"\d+").Value);
Output("Seeders: " + seeders);
// Leechers
var leechers = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(6) > div > font").Text(), @"\d+").Value);
var leechers = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(5) > div > font").Text(), @"\d+").Value);
Output("Leechers: " + leechers);
// Completed
var completed = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(4)").Text(), @"\d+").Value);
Output("Completed: " + completed);
// Files
var files = 1;
if (tRow.Find("td:eq(3) > a").Length == 1)
{
files = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(3) > a").Text(), @"\d+").Value);
}
var files = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(2)").Text(), @"\d+").Value);
Output("Files: " + files);
// Comments
var comments = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(3)").Text(), @"\d+").Value);
Output("Comments: " + files);
// Health
var percent = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(7) > img").Attr("src"), @"\d+").Value) * 10;
var percent = ParseUtil.CoerceInt(Regex.Match(tRow.Find("td:eq(6) > img").Attr("src"), @"\d+").Value) * 10;
Output("Health: " + percent + "%");
// Size
var humanSize = tRow.Find("td:eq(8)").Text().ToLowerInvariant();
var humanSize = tRow.Find("td:eq(7)").Text().ToLowerInvariant();
var size = ReleaseInfo.GetBytes(humanSize);
Output("Size: " + humanSize + " (" + size + " bytes)");
// Date & IMDB & Genre
// Date & Genre
var infosData = tRow.Find("td:eq(1) > div:last").Text();
var infosList = Regex.Split(infosData, "\\|").ToList();
var infosTorrent = infosList.Select(s => s.Split(new[] { ':' }, 2)[1].Trim()).ToList();

View File

@@ -17,7 +17,7 @@ namespace Jackett.Indexers
{
public class SpeedCD : BaseIndexer, IIndexer
{
private string LoginUrl { get { return SiteLink + "take.login.php"; } }
private string LoginUrl { get { return SiteLink + "takelogin.php"; } }
private string SearchUrl { get { return SiteLink + "browse.php"; } }
new ConfigurationDataBasicLogin configData
@@ -70,24 +70,39 @@ namespace Jackett.Indexers
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{
configData.LoadValuesFromJson(configJson);
await DoLogin();
return IndexerConfigurationStatus.RequiresTesting;
}
private async Task DoLogin()
{
var pairs = new Dictionary<string, string> {
{ "username", configData.Username.Value },
{ "password", configData.Password.Value },
};
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, SiteLink);
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
{
CQ dom = result.Content;
var errorMessage = dom["h5"].First().Text().Trim();
throw new ExceptionWithConfigData(errorMessage, configData);
});
return IndexerConfigurationStatus.RequiresTesting;
}
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
var loggedInCheck = await RequestStringWithCookies(SearchUrl);
if (!loggedInCheck.Content.Contains("/logout.php"))
{
//Cookie appears to expire after a period of time or logging in to the site via browser
await DoLogin();
}
var releases = new List<ReleaseInfo>();
NameValueCollection qParams = new NameValueCollection();

View File

@@ -61,9 +61,12 @@ namespace Jackett.Indexers
AddCategoryMapping(44, TorznabCatType.MoviesSD);
AddCategoryMapping(1, TorznabCatType.MoviesSD);
// Music foreign
// Music packs
// Music videos
// Music
AddCategoryMapping(17, TorznabCatType.AudioMP3);
AddCategoryMapping(44, TorznabCatType.AudioLossless);
AddCategoryMapping(23, TorznabCatType.AudioForeign);
AddCategoryMapping(41, TorznabCatType.AudioOther);
AddCategoryMapping(16, TorznabCatType.AudioVideo);
AddCategoryMapping(4, TorznabCatType.PCGames);
// ps3

View File

@@ -151,6 +151,10 @@ namespace Jackett.Indexers
release.Link = new Uri(SiteLink + qRow.Find(".quickdownload > a").Attr("href").Substring(1));
var dateString = qRow.Find(".name")[0].InnerText.Trim().Replace(" ", string.Empty).Replace("Addedinon", string.Empty);
//Fix for issue 2016-04-30
dateString = dateString.Replace("\r", "").Replace("\n", "");
//"2015-04-25 23:38:12"
//"yyyy-MMM-dd hh:mm:ss"
release.PublishDate = DateTime.ParseExact(dateString, "yyyy-MM-ddHH:mm:ss", CultureInfo.InvariantCulture);

View File

@@ -101,7 +101,10 @@ namespace Jackett.Indexers
}
else
{
title = title.Remove(title.LastIndexOf("."));
if (title.Length > 5 && title.Substring(title.Length - 5).Contains("."))
{
title = title.Remove(title.LastIndexOf("."));
}
}
release.Title = title;

View File

@@ -213,6 +213,11 @@ namespace Jackett.Services
/// <returns></returns>
public static string GetAppDataFolderStatic()
{
if (!string.IsNullOrWhiteSpace(Startup.CustomDataFolder))
{
return Startup.CustomDataFolder;
}
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett");

View File

@@ -58,6 +58,12 @@ namespace Jackett
set;
}
public static string CustomDataFolder
{
get;
set;
}
public static string BasePath
{
get;

View File

@@ -46,6 +46,8 @@ namespace Jackett.Utils.Clients
private async Task<WebClientByteResult> Run(WebRequest webRequest)
{
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
var cookies = new CookieContainer();
if (!string.IsNullOrEmpty(webRequest.Cookies))
{