1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-29 18:15:37 -04:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Taloth Saldono
40e5626ddb Added a few more codecs, not even halfway. 2017-08-03 19:26:14 +02:00
Taloth Saldono
1b9ccc319f Fixed: TLS issue for OSX. 2017-08-03 16:53:15 +02:00
Taloth Saldono
89e804814b Revert "Change default tls provider so users won't have to set TLS_PROVIDER explicitly."
This reverts commit 8e63f7d436.

Only certain platforms need it and causes issues with OSX and cases where the user relies on btls.
2017-08-03 16:53:11 +02:00
Taloth Saldono
ce6a5713d1 Lets not take any risks here. 2017-08-03 00:20:48 +02:00
5 changed files with 39 additions and 18 deletions

View File

@@ -47,19 +47,19 @@ namespace NzbDrone.Common.Http.Dispatchers
AddRequestHeaders(webRequest, request.Headers);
}
if (request.ContentData != null)
{
webRequest.ContentLength = request.ContentData.Length;
using (var writeStream = webRequest.GetRequestStream())
{
writeStream.Write(request.ContentData, 0, request.ContentData.Length);
}
}
HttpWebResponse httpWebResponse;
try
{
if (request.ContentData != null)
{
webRequest.ContentLength = request.ContentData.Length;
using (var writeStream = webRequest.GetRequestStream())
{
writeStream.Write(request.ContentData, 0, request.ContentData.Length);
}
}
httpWebResponse = (HttpWebResponse)webRequest.GetResponse();
}
catch (WebException e)
@@ -78,13 +78,17 @@ namespace NzbDrone.Common.Http.Dispatchers
{
throw new WebException($"DNS Name Resolution Failure: '{webRequest.RequestUri.Host}'", e.Status);
}
else if (e.Status == WebExceptionStatus.SendFailure && e.ToString().Contains("The authentication or decryption has failed."))
else if (e.ToString().Contains("TLS Support not"))
{
throw new TlsFailureException(webRequest, e);
}
else if (e.ToString().Contains("The authentication or decryption has failed."))
{
throw new TlsFailureException(webRequest, e);
}
else if (OsInfo.IsNotWindows)
{
throw new WebException($"{e.Message}: '{webRequest.RequestUri}'", e.Status);
throw new WebException($"{e.Message}: '{webRequest.RequestUri}'", e, e.Status, e.Response);
}
else
{

View File

@@ -2,7 +2,6 @@
using System.Net;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation;
namespace NzbDrone.Common.Security
@@ -19,11 +18,6 @@ namespace NzbDrone.Common.Security
if (OsInfo.IsNotWindows)
{
// This was never meant to be used on mono, and will cause issues with mono 5 and higher if btls is enabled.
// Instead, force TLS provider to legacy for now due to conflict between btls and mediainfo, unless the user explicitly specified it.
if (Environment.GetEnvironmentVariable("MONO_TLS_PROVIDER").IsNullOrWhiteSpace())
{
Environment.SetEnvironmentVariable("MONO_TLS_PROVIDER", "legacy");
}
return;
}

View File

@@ -30,6 +30,8 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
[TestCase("TrueHD, A_TRUEHD, , ", "", "TrueHD")]
[TestCase("WMA, 161, , ", "Droned.wmv", "WMA")]
[TestCase("WMA, 162, Pro, ", "B.N.S04E18.720p.WEB-DL", "WMA")]
[TestCase("Opus, A_OPUS, , ", "Roadkill Ep3x11 - YouTube.webm", "Opus")]
[TestCase("mp3 , 0, , ", "climbing.mp4", "MP3")]
public void should_format_audio_format(string audioFormatPack, string sceneName, string expectedFormat)
{
var split = audioFormatPack.Split(new string[] { ", " }, System.StringSplitOptions.None);

View File

@@ -34,6 +34,11 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
[TestCase("V.MPEG4/ISO/AVC, V.MPEG4/ISO/AVC, , ", "pd.2015.S03E08.720p.iP.WEBRip.AAC2.0.H264-BTW", "h264")]
[TestCase("WMV2, WMV2, , ", "Droned.wmv", "WMV")]
[TestCase("xvid, xvid, , ", "", "XviD")]
[TestCase("div3, div3, , ", "spsm.dvdrip.divx.avi'.", "DivX")]
[TestCase("VP6, 4, , ", "Top Gear - S12E01 - Lorries - SD TV.flv", "VP6")]
[TestCase("VP7, VP70, General, ", "Sweet Seymour.avi", "VP7")]
[TestCase("VP8, V_VP8, , ", "Dick.mkv", "VP8")]
[TestCase("VP9, V_VP9, , ", "Roadkill Ep3x11 - YouTube.webm", "VP9")]
public void should_format_video_format(string videoFormatPack, string sceneName, string expectedFormat)
{
var split = videoFormatPack.Split(new string[] { ", " }, System.StringSplitOptions.None);

View File

@@ -89,6 +89,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
return "FLAC";
}
if (audioFormat.Trim().EqualsIgnoreCase("mp3"))
{
return "MP3";
}
if (audioFormat.EqualsIgnoreCase("MPEG Audio"))
{
if (mediaInfo.AudioCodecID == "55" || mediaInfo.AudioCodecID == "A_MPEG/L3" || mediaInfo.AudioProfile == "Layer 3")
@@ -102,6 +107,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
}
}
if (audioFormat.EqualsIgnoreCase("Opus"))
{
return "Opus";
}
if (audioFormat.EqualsIgnoreCase("PCM"))
{
return "PCM";
@@ -214,7 +224,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
return GetSceneNameMatch(sceneName, "AVC", "h264");
}
if (videoFormat.EqualsIgnoreCase("DivX"))
if (videoFormat.EqualsIgnoreCase("DivX") || videoFormat.EqualsIgnoreCase("div3"))
{
return "DivX";
}
@@ -267,6 +277,12 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
return "VC1";
}
if (videoFormat.EqualsIgnoreCase("VP6") || videoFormat.EqualsIgnoreCase("VP7") ||
videoFormat.EqualsIgnoreCase("VP8") || videoFormat.EqualsIgnoreCase("VP9"))
{
return videoFormat.ToUpperInvariant();
}
if (videoFormat == "WMV2")
{
return "WMV";