From e09f389f588521b647f5fdcb979ec0c1f1f05c89 Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Sun, 4 Aug 2024 10:12:01 +0200 Subject: [PATCH] Handle removal of (Official HD Video) (#364) --- src/rules.ts | 4 ++-- test/fixtures/functions/youtube.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rules.ts b/src/rules.ts index 3377399..0a52d5c 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -185,8 +185,8 @@ export const YOUTUBE_TRACK_FILTER_RULES: FilterRule[] = [ { source: /\(.*lyrics?\s*(video)?\)/i, target: '' }, // ((Official)? (Track)? Stream) { source: /\((of+icial\s*)?(track\s*)?stream\)/i, target: '' }, - // ((Official)? (Music)? Video|Audio) - { source: /\((of+icial\s*)?(music\s*)?(video|audio)\)/i, target: '' }, + // ((Official)? (Music|HD)? Video|Audio) + { source: /\((of+icial\s*)?((music|hd)\s*)?(video|audio)\)/i, target: '' }, // - (Official)? (Music)? Video|Audio { source: /-\s(of+icial\s*)?(music\s*)?(video|audio)$/i, target: '' }, // ((Whatever)? Album Track) diff --git a/test/fixtures/functions/youtube.json b/test/fixtures/functions/youtube.json index 1e9e999..8a13192 100644 --- a/test/fixtures/functions/youtube.json +++ b/test/fixtures/functions/youtube.json @@ -134,6 +134,11 @@ "funcParameter": "Track Title (Official Music Video)", "expectedValue": "Track Title" }, + { + "description": "should remove 'Official HD Video' string", + "funcParameter": "Track Title (Official HD Video)", + "expectedValue": "Track Title" + }, { "description": "should remove '- Official Music Video' string", "funcParameter": "Track Title - Official Music Video",