fixed unicode bs

This commit is contained in:
Hellow 2023-04-06 16:34:51 +02:00
parent f5f56a7eff
commit 3acfa417e8

View File

@ -41,6 +41,12 @@ EXIT_COMMANDS = {
"quit" "quit"
} }
def print_cute_message():
message = get_random_message()
try:
print(message)
except UnicodeDecodeError:
print((c for c in message if 0 < ord(c) < 127))
def cli(genre: str = None, download_all: bool = False): def cli(genre: str = None, download_all: bool = False):
def get_existing_genre() -> List[str]: def get_existing_genre() -> List[str]:
@ -141,7 +147,7 @@ def cli(genre: str = None, download_all: bool = False):
genre = get_genre() genre = get_genre()
print() print()
print(get_random_message()) print_cute_message()
print() print()
print(f"Downloading to: \"{genre}\"") print(f"Downloading to: \"{genre}\"")
print() print()
@ -154,5 +160,5 @@ def cli(genre: str = None, download_all: bool = False):
print(search) print(search)
print() print()
print(get_random_message()) print_cute_message()
print("Have fun with your music. :3") print("Have fun with your music. :3")