mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-15 16:34:11 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0fc3d224ab | ||
![]() |
ac07cc34cd | ||
![]() |
3730e05f20 | ||
![]() |
2644fd813e | ||
![]() |
ece16d1075 | ||
![]() |
3b13fa84a4 | ||
![]() |
cda5ea3207 | ||
![]() |
0746616b43 | ||
![]() |
28199ab4be | ||
![]() |
b29c578adb | ||
![]() |
b42f2a0972 |
@@ -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
|
||||
|
@@ -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; }
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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");
|
||||
|
@@ -58,6 +58,12 @@ namespace Jackett
|
||||
set;
|
||||
}
|
||||
|
||||
public static string CustomDataFolder
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public static string BasePath
|
||||
{
|
||||
get;
|
||||
|
@@ -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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user