Use unidecode to escape weird names
This commit is contained in:
@@ -2,3 +2,4 @@ spotipy==2.10.0
|
|||||||
tidalapi==0.6.8
|
tidalapi==0.6.8
|
||||||
pyyaml==5.3.1
|
pyyaml==5.3.1
|
||||||
tqdm==4.45.0
|
tqdm==4.45.0
|
||||||
|
unidecode==1.2.0
|
||||||
|
|||||||
3
sync.py
3
sync.py
@@ -9,13 +9,14 @@ import spotipy
|
|||||||
import tidalapi
|
import tidalapi
|
||||||
import time
|
import time
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
from unidecode import unidecode
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
def simple(input_string):
|
def simple(input_string):
|
||||||
# only take the first part of a string before any hyphens or brackets to account for different versions
|
# 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):
|
def duration_match(tidal_track, spotify_track, tolerance=2):
|
||||||
# the duration of the two tracks must be the same to within 2 seconds
|
# the duration of the two tracks must be the same to within 2 seconds
|
||||||
|
|||||||
Reference in New Issue
Block a user