Skip to content

Commit

Permalink
Handle removal of (Official HD Video) (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse authored Aug 4, 2024
1 parent dd4baae commit e09f389
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/functions/youtube.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e09f389

Please sign in to comment.