diff --git a/requirements.txt b/requirements.txt index d839a0b..c6ea7af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ spotipy==2.10.0 tidalapi==0.6.8 pyyaml==5.3.1 tqdm==4.45.0 +unidecode==1.2.0 diff --git a/sync.py b/sync.py index 04a25fe..9d50a02 100755 --- a/sync.py +++ b/sync.py @@ -9,13 +9,14 @@ import spotipy import tidalapi import time from tqdm import tqdm +from unidecode import unidecode from urllib.parse import urljoin import webbrowser import yaml def simple(input_string): # only take the first part of a string before any hyphens or brackets to account for different versions - return input_string.split('-')[0].strip().split('(')[0].strip().split('[')[0].strip() + return unidecode(input_string).split('-')[0].strip().split('(')[0].strip().split('[')[0].strip() def duration_match(tidal_track, spotify_track, tolerance=2): # the duration of the two tracks must be the same to within 2 seconds