From f9e045d14c0bc7a16159e3850bf755351ada5035 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 2 Oct 2020 15:02:41 -0700 Subject: [PATCH] Fixed: Handle obfuscated files using abc.xyz pattern Closes #3990 --- src/NzbDrone.Core.Test/ParserTests/CrapParserFixture.cs | 1 + src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs | 7 +++++++ src/NzbDrone.Core/Parser/Parser.cs | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/CrapParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/CrapParserFixture.cs index bc53c600d..8cadfb650 100644 --- a/src/NzbDrone.Core.Test/ParserTests/CrapParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/CrapParserFixture.cs @@ -31,6 +31,7 @@ public class CrapParserFixture : CoreTest [TestCase("ah63jka93jf0jh26ahjas961.mkv")] [TestCase("qrdSD3rYzWb7cPdVIGSn4E7")] [TestCase("QZC4HDl7ncmzyUj9amucWe1ddKU1oFMZDd8r0dEDUsTd")] + [TestCase("abc.xyz.af6021c37f7852")] public void should_not_parse_crap(string title) { Parser.Parser.ParseTitle(title).Should().BeNull(); diff --git a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs index 663581d75..ecc7f87b6 100644 --- a/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs @@ -108,6 +108,13 @@ public class HashedReleaseFixture : CoreTest "Droned", Quality.HDTV720p, null + }, + new object[] + { + @"C:\Test\Series.Title.S02E24.720p.HDTV.H.264\abc.xyz.af6021c37f7852.mkv".AsOsAgnostic(), + "Series Title", + Quality.HDTV720p, + null } }; diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 5ac96dc8d..0aa3dbbbe 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -258,7 +258,7 @@ public static class Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports 1103/1113 naming - new Regex(@"^(?.+?)?(?:(?:[-_\W](?<![()\[!]))*(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+|\W(?:e|ep|x)\d+)))+(\W+|_|$)(?!\\)", + new Regex(@"^(?<title>.+?)?(?:(?:[-_. ](?<![()\[!]))*(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+|\W(?:e|ep|x)\d+)))+([-_. ]+|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Episodes with single digit episode number (S01E1, S01E5E6, etc) @@ -334,6 +334,9 @@ public static class Parser //abc - Started appearing January 2015 new Regex(@"^abc$", RegexOptions.Compiled | RegexOptions.IgnoreCase), + //abc - Started appearing 2020 + new Regex(@"^abc[-_. ]xyz", RegexOptions.Compiled | RegexOptions.IgnoreCase), + //b00bs - Started appearing January 2015 new Regex(@"^b00bs$", RegexOptions.Compiled | RegexOptions.IgnoreCase),