Skip to content

Commit

Permalink
fix: wrong songs downloaded when dots in song name
Browse files Browse the repository at this point in the history
  • Loading branch information
lfavole committed Jan 9, 2025
1 parent 6decb68 commit 2a92dda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion songs_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,9 @@ def order_results(provider: str, best_items: list[Song], results: dict[str, list
ret: list[tuple[Song, float, list[float]]] = []

def normalize_title(title: str):
return re.sub(r"\bst(e?s?)\.?(\s+|$)", r"saint\1\2", title)
title = re.sub(r"\.\s*(?=\w\W|\w$|$)", "", title)
title = re.sub(r"\bst(e?s?)(\s+|$)", r"saint\1\2", title)
return title

for result in results[provider]:
# check for common word
Expand Down

0 comments on commit 2a92dda

Please sign in to comment.