diff --git a/src/rules.ts b/src/rules.ts index 16ce416..6132d8f 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -41,8 +41,10 @@ export const YOUTUBE_TRACK_FILTER_RULES: FilterRule[] = [ { source: /\(\s*of+icial\s*\)/i, target: '' }, // (1999) { source: /\(\s*[0-9]{4}\s*\)/i, target: '' }, - // HD (HQ) - { source: /(HD|HQ)\s*$/, target: '' }, + // (HD) / (HQ) + { source: /\(\s*(HD|HQ)\s*\)$/, target: '' }, + // HD / HQ + { source: /(HD|HQ)\s?$/, target: '' }, // video clip officiel or video clip official { source: /(vid[\u00E9e]o)?\s?clip\sof+ici[ae]l/i, target: '' }, // offizielles diff --git a/test/function/youtube.spec.ts b/test/function/youtube.spec.ts index b19de04..f4eb2b7 100644 --- a/test/function/youtube.spec.ts +++ b/test/function/youtube.spec.ts @@ -38,11 +38,21 @@ testFilterFunction(youtube, [ funcParameter: 'Track Title HD', expectedValue: 'Track Title', }, + { + description: 'should remove "(HD)" string', + funcParameter: 'Track Title (HD)', + expectedValue: 'Track Title', + }, { description: 'should remove "HQ" string', funcParameter: 'Track Title HQ', expectedValue: 'Track Title', }, + { + description: 'should remove "(HQ)" string', + funcParameter: 'Track Title (HQ)', + expectedValue: 'Track Title', + }, { description: 'should extract title from single quotes', funcParameter: "'Track Title'",