New: Remove websites in parentheses before parsing
This commit is contained in:
parent
45fe585944
commit
ea4fe392a0
|
@ -23,6 +23,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
||||||
[TestCase("[www.test-hyphen.ca] - Series (2011) S01", "Series (2011)")]
|
[TestCase("[www.test-hyphen.ca] - Series (2011) S01", "Series (2011)")]
|
||||||
[TestCase("test123.ca - Series Time S02 720p HDTV x264 CRON", "Series Time")]
|
[TestCase("test123.ca - Series Time S02 720p HDTV x264 CRON", "Series Time")]
|
||||||
[TestCase("[www.test-hyphen123.co.za] - Series Title S01E01", "Series Title")]
|
[TestCase("[www.test-hyphen123.co.za] - Series Title S01E01", "Series Title")]
|
||||||
|
[TestCase("(seriesawake.com) Series Super - 57 [720p] [English Subbed]", "Series Super")]
|
||||||
|
|
||||||
public void should_not_parse_url_in_name(string postTitle, string title)
|
public void should_not_parse_url_in_name(string postTitle, string title)
|
||||||
{
|
{
|
||||||
|
|
|
@ -514,7 +514,7 @@ namespace NzbDrone.Core.Parser
|
||||||
|
|
||||||
// Valid TLDs http://data.iana.org/TLD/tlds-alpha-by-domain.txt
|
// Valid TLDs http://data.iana.org/TLD/tlds-alpha-by-domain.txt
|
||||||
|
|
||||||
private static readonly RegexReplace WebsitePrefixRegex = new RegexReplace(@"^(?:\[\s*)?(?:www\.)?[-a-z0-9-]{1,256}\.(?<!Naruto-Kun\.)(?:[a-z]{2,6}\.[a-z]{2,6}|xn--[a-z0-9-]{4,}|[a-z]{2,})\b(?:\s*\]|[ -]{2,})[ -]*",
|
private static readonly RegexReplace WebsitePrefixRegex = new RegexReplace(@"^(?:(?:\[|\()\s*)?(?:www\.)?[-a-z0-9-]{1,256}\.(?<!Naruto-Kun\.)(?:[a-z]{2,6}\.[a-z]{2,6}|xn--[a-z0-9-]{4,}|[a-z]{2,})\b(?:\s*(?:\]|\))|[ -]{2,})[ -]*",
|
||||||
string.Empty,
|
string.Empty,
|
||||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue