From 469712c0276f6a04ac8a53b52d8fbd128cad1211 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Jul 2015 12:54:15 -0600 Subject: [PATCH] Fixes for loading saved cookie problems --- src/CurlSharp/CurlSharp.csproj | 12 ++++- src/Jackett.sln | 46 +++++++++++++++-- src/Jackett/CookieContainerExtensions.cs | 64 ++++++++++++++++-------- src/Jackett/Indexers/AlphaRatio.cs | 20 +++----- src/Jackett/Indexers/AnimeBytes.cs | 4 +- src/Jackett/Indexers/BitHdtv.cs | 4 +- src/Jackett/Indexers/BitMeTV.cs | 4 +- src/Jackett/Indexers/Freshon.cs | 4 +- src/Jackett/Indexers/IPTorrents.cs | 4 +- src/Jackett/Indexers/MoreThanTV.cs | 13 +++-- src/Jackett/Indexers/SceneAccess.cs | 11 ++-- src/Jackett/Indexers/TorrentDay.cs | 4 +- src/Jackett/Indexers/TorrentLeech.cs | 4 +- src/Jackett/Indexers/TorrentShack.cs | 4 +- src/Jackett/Jackett.csproj | 23 ++++++--- src/Jackett/Main.Designer.cs | 7 ++- src/Jackett/Main.cs | 4 +- src/Jackett/Program.cs | 7 +++ src/Jackett/packages.config | 6 +-- 19 files changed, 164 insertions(+), 81 deletions(-) diff --git a/src/CurlSharp/CurlSharp.csproj b/src/CurlSharp/CurlSharp.csproj index 4173495d8..849dc60ab 100644 --- a/src/CurlSharp/CurlSharp.csproj +++ b/src/CurlSharp/CurlSharp.csproj @@ -10,8 +10,6 @@ CurlSharp CurlSharp 512 - 12.0.0 - 2.0 true @@ -86,4 +84,14 @@ --> + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.sln b/src/Jackett.sln index 850174ffe..eae7d18ea 100644 --- a/src/Jackett.sln +++ b/src/Jackett.sln @@ -1,5 +1,6 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 +# Visual Studio 2012 VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 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 EndGlobalSection 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.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.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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Jackett/CookieContainerExtensions.cs b/src/Jackett/CookieContainerExtensions.cs index 05bcfdc2e..447c3be30 100644 --- a/src/Jackett/CookieContainerExtensions.cs +++ b/src/Jackett/CookieContainerExtensions.cs @@ -5,29 +5,53 @@ using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; +using System.Web; namespace Jackett { - public static class CookieContainerExtensions - { - public static void FillFromJson (this CookieContainer cookies, Uri uri, JArray json) - { - foreach (string cookie in json) { + public static class CookieContainerExtensions + { - 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 void FillFromJson(this CookieContainer cookies, Uri uri, JToken json) + { + if (json["cookies"] != null) + { + 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) - { - return new JArray (( - from cookie in cookies.GetCookies (baseUrl).Cast () - select cookie.Name.Trim () + "=" + cookie.Value.Trim () - ).ToArray ()); - } - } + if (json["cookie_header"] != null) + { + var cfh = (string)json["cookie_header"]; + var cookieHeaders = ((string)json["cookie_header"]).Split(';'); + foreach (var c in cookieHeaders) + { + 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); + } + } } diff --git a/src/Jackett/Indexers/AlphaRatio.cs b/src/Jackett/Indexers/AlphaRatio.cs index 3ff758bb5..1be0bf14d 100644 --- a/src/Jackett/Indexers/AlphaRatio.cs +++ b/src/Jackett/Indexers/AlphaRatio.cs @@ -75,16 +75,13 @@ namespace Jackett.Indexers public async Task ApplyConfiguration(JToken configJson) { - cookies = new CookieContainer(); - client = new HttpClient(handler); - var configSaveData = new JObject(); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); var config = new ConfigurationDataBasicLogin(); config.LoadValuesFromJson(configJson); - + var pairs = new Dictionary { { "username", config.Username.Value }, { "password", @config.Password.Value }, @@ -95,17 +92,18 @@ namespace Jackett.Indexers var content = new FormUrlEncodedContent(pairs); var message = CreateHttpRequest(new Uri(LoginUrl)); message.Content = content; - - //message.Headers.Referrer = new Uri(LoginUrl); + + //message.Headers.Referrer = new Uri(LoginUrl); string responseContent; - JArray cookieJArray; + + configSaveData = new JObject(); if (Program.IsWindows) { // If Windows use .net http var response = await client.SendAsync(message); responseContent = await response.Content.ReadAsStringAsync(); - cookieJArray = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); } else { @@ -113,7 +111,7 @@ namespace Jackett.Indexers var response = await CurlHelper.PostAsync(LoginUrl, pairs); responseContent = Encoding.UTF8.GetString(response.Content); cookieHeader = response.CookieHeader; - cookieJArray = new JArray(response.CookiesFlat); + configSaveData["cookie_header"] = cookieHeader; } if (!responseContent.Contains("logout.php?")) @@ -126,8 +124,6 @@ namespace Jackett.Indexers } else { - configSaveData = new JObject(); - configSaveData["cookies"] = cookieJArray; if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -146,7 +142,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(SiteLink, (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(SiteLink, jsonConfig); cookieHeader = cookies.GetCookieHeader(SiteLink); IsConfigured = true; } diff --git a/src/Jackett/Indexers/AnimeBytes.cs b/src/Jackett/Indexers/AnimeBytes.cs index 36f5de8bc..f271e28db 100644 --- a/src/Jackett/Indexers/AnimeBytes.cs +++ b/src/Jackett/Indexers/AnimeBytes.cs @@ -131,7 +131,7 @@ namespace Jackett.Indexers { AllowRaws = config.IncludeRaw.Value; var configSaveData = new JObject(); - configSaveData["cookies"] = cookieContainer.ToJson(SiteLink); + cookieContainer.DumpToJson(SiteLink, configSaveData); configSaveData["raws"] = AllowRaws; if (OnSaveConfigurationRequested != null) @@ -143,7 +143,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookieContainer.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookieContainer.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; AllowRaws = jsonConfig["raws"].Value(); } diff --git a/src/Jackett/Indexers/BitHdtv.cs b/src/Jackett/Indexers/BitHdtv.cs index 1c394b389..2e75414b7 100644 --- a/src/Jackett/Indexers/BitHdtv.cs +++ b/src/Jackett/Indexers/BitHdtv.cs @@ -86,7 +86,7 @@ namespace Jackett.Indexers else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -101,7 +101,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/BitMeTV.cs b/src/Jackett/Indexers/BitMeTV.cs index 3a15659c6..032142bc6 100644 --- a/src/Jackett/Indexers/BitMeTV.cs +++ b/src/Jackett/Indexers/BitMeTV.cs @@ -111,7 +111,7 @@ namespace Jackett else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -122,7 +122,7 @@ namespace Jackett public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/Freshon.cs b/src/Jackett/Indexers/Freshon.cs index 7dc68a11c..37bbde239 100644 --- a/src/Jackett/Indexers/Freshon.cs +++ b/src/Jackett/Indexers/Freshon.cs @@ -90,7 +90,7 @@ namespace Jackett else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -101,7 +101,7 @@ namespace Jackett public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/IPTorrents.cs b/src/Jackett/Indexers/IPTorrents.cs index 53c43de0f..a5c0de73f 100644 --- a/src/Jackett/Indexers/IPTorrents.cs +++ b/src/Jackett/Indexers/IPTorrents.cs @@ -89,7 +89,7 @@ namespace Jackett.Indexers else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -110,7 +110,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(Newtonsoft.Json.Linq.JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/MoreThanTV.cs b/src/Jackett/Indexers/MoreThanTV.cs index d9fb0ee13..c4fe43a2a 100644 --- a/src/Jackett/Indexers/MoreThanTV.cs +++ b/src/Jackett/Indexers/MoreThanTV.cs @@ -86,14 +86,16 @@ namespace Jackett.Indexers var content = new FormUrlEncodedContent(pairs); string responseContent; - JArray cookieJArray; + + var configSaveData = new JObject(); if (Program.IsWindows) { // If Windows use .net http var response = await client.PostAsync(LoginUrl, content); responseContent = await response.Content.ReadAsStringAsync(); - cookieJArray = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); + } else { @@ -101,7 +103,7 @@ namespace Jackett.Indexers var response = await CurlHelper.PostAsync(LoginUrl, pairs); responseContent = Encoding.UTF8.GetString(response.Content); cookieHeader = response.CookieHeader; - cookieJArray = new JArray(response.CookiesFlat); + configSaveData["cookie_header"] = cookieHeader; } if (!responseContent.Contains("logout.php?")) @@ -114,9 +116,6 @@ namespace Jackett.Indexers } else { - - var configSaveData = new JObject(); - configSaveData["cookies"] = cookieJArray; if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -126,7 +125,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(SiteLink, (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(SiteLink, jsonConfig); cookieHeader = cookies.GetCookieHeader(SiteLink); IsConfigured = true; } diff --git a/src/Jackett/Indexers/SceneAccess.cs b/src/Jackett/Indexers/SceneAccess.cs index 9de70fc16..d29372658 100644 --- a/src/Jackett/Indexers/SceneAccess.cs +++ b/src/Jackett/Indexers/SceneAccess.cs @@ -80,14 +80,14 @@ namespace Jackett.Indexers var content = new FormUrlEncodedContent(pairs); string responseContent; - JArray cookieJArray; + var configSaveData = new JObject(); if (Program.IsWindows) { // If Windows use .net http var response = await client.PostAsync(LoginUrl, content); responseContent = await response.Content.ReadAsStringAsync(); - cookieJArray = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); } else { @@ -95,7 +95,7 @@ namespace Jackett.Indexers var response = await CurlHelper.PostAsync(LoginUrl, pairs); responseContent = Encoding.UTF8.GetString(response.Content); cookieHeader = response.CookieHeader; - cookieJArray = new JArray(response.CookiesFlat); + configSaveData["cookie_header"] = cookieHeader; } if (!responseContent.Contains("nav_profile")) @@ -107,9 +107,6 @@ namespace Jackett.Indexers } else { - var configSaveData = new JObject(); - configSaveData["cookies"] = cookieJArray; - if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -119,7 +116,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); cookieHeader = cookies.GetCookieHeader(SiteLink); IsConfigured = true; } diff --git a/src/Jackett/Indexers/TorrentDay.cs b/src/Jackett/Indexers/TorrentDay.cs index 3ebf9a1ff..70c2914fc 100644 --- a/src/Jackett/Indexers/TorrentDay.cs +++ b/src/Jackett/Indexers/TorrentDay.cs @@ -107,7 +107,7 @@ namespace Jackett.Indexers else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -118,7 +118,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/TorrentLeech.cs b/src/Jackett/Indexers/TorrentLeech.cs index b4a29f160..c865059a3 100644 --- a/src/Jackett/Indexers/TorrentLeech.cs +++ b/src/Jackett/Indexers/TorrentLeech.cs @@ -90,7 +90,7 @@ namespace Jackett.Indexers else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -101,7 +101,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Indexers/TorrentShack.cs b/src/Jackett/Indexers/TorrentShack.cs index 7945a77c4..b3de5973d 100644 --- a/src/Jackett/Indexers/TorrentShack.cs +++ b/src/Jackett/Indexers/TorrentShack.cs @@ -91,7 +91,7 @@ namespace Jackett.Indexers else { var configSaveData = new JObject(); - configSaveData["cookies"] = cookies.ToJson(SiteLink); + cookies.DumpToJson(SiteLink, configSaveData); if (OnSaveConfigurationRequested != null) OnSaveConfigurationRequested(this, configSaveData); @@ -103,7 +103,7 @@ namespace Jackett.Indexers public void LoadFromSavedConfiguration(JToken jsonConfig) { - cookies.FillFromJson(new Uri(BaseUrl), (JArray)jsonConfig["cookies"]); + cookies.FillFromJson(new Uri(BaseUrl), jsonConfig); IsConfigured = true; } diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj index 9f7154e49..af603b00d 100644 --- a/src/Jackett/Jackett.csproj +++ b/src/Jackett/Jackett.csproj @@ -57,11 +57,9 @@ ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll - - ..\packages\modernhttpclient.2.3.0\lib\Portable-Net45+WinRT45+WP8+WPA81\ModernHttpClient.dll - - - ..\packages\NLog.3.2.0.0\lib\net45\NLog.dll + + ..\packages\NLog.Windows.Forms.2.0.0.0\lib\net35\NLog.Windows.Forms.dll + True @@ -76,7 +74,10 @@ - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\packages\NLog.4.0.1\lib\net45\NLog.dll @@ -293,4 +294,14 @@ --> + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett/Main.Designer.cs b/src/Jackett/Main.Designer.cs index fff94fc29..d881a2821 100644 --- a/src/Jackett/Main.Designer.cs +++ b/src/Jackett/Main.Designer.cs @@ -1,4 +1,6 @@ -namespace Jackett +#if !__MonoCS__ + +namespace Jackett { partial class Main { @@ -97,4 +99,5 @@ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemShutdown; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Jackett/Main.cs b/src/Jackett/Main.cs index 129b9224c..250aff2ce 100644 --- a/src/Jackett/Main.cs +++ b/src/Jackett/Main.cs @@ -1,4 +1,5 @@ -using Microsoft.Win32; +#if !__MonoCS__ +using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; @@ -92,3 +93,4 @@ namespace Jackett } } } +#endif \ No newline at end of file diff --git a/src/Jackett/Program.cs b/src/Jackett/Program.cs index 08bd34a40..cc16b2bc1 100644 --- a/src/Jackett/Program.cs +++ b/src/Jackett/Program.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json.Linq; using NLog; using NLog.Config; using NLog.Targets; +using NLog.Windows.Forms; using System; using System.Collections.Generic; using System.Diagnostics; @@ -70,12 +71,14 @@ namespace Jackett if (Program.IsWindows) { +#if !__MonoCS__ var logAlert = new MessageBoxTarget(); logConfig.AddTarget("alert", logAlert); logAlert.Layout = "${message}"; logAlert.Caption = "Alert"; var logAlertRule = new LoggingRule("*", LogLevel.Fatal, logAlert); logConfig.LoggingRules.Add(logAlertRule); +#endif } var logConsole = new ConsoleTarget(); @@ -98,7 +101,11 @@ namespace Jackett try { if (Program.IsWindows) + { +#if !__MonoCS__ Application.Run(new Main()); +#endif + } } catch (Exception) { diff --git a/src/Jackett/packages.config b/src/Jackett/packages.config index f5186f515..efab650c9 100644 --- a/src/Jackett/packages.config +++ b/src/Jackett/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file