force lrc file to utf-8
This commit is contained in:
parent
ff527fe834
commit
8cfd27407e
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.6.12
|
||||||
|
- Dockerfile works again
|
||||||
|
- Fixed lrc file extension replacement
|
||||||
|
- Fixed lrc file writes breaking on non-utf8 systems
|
||||||
|
|
||||||
## 0.6.11
|
## 0.6.11
|
||||||
- Add new scope for reading followed artists
|
- Add new scope for reading followed artists
|
||||||
- Print API errors by default
|
- Print API errors by default
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = zotify
|
name = zotify
|
||||||
version = 0.6.11
|
version = 0.6.12
|
||||||
author = Zotify Contributors
|
author = Zotify Contributors
|
||||||
description = A highly customizable music and podcast downloader
|
description = A highly customizable music and podcast downloader
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
|
|
|
@ -113,12 +113,12 @@ def get_song_lyrics(song_id: str, file_save: str) -> None:
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ValueError(f'Failed to fetch lyrics: {song_id}')
|
raise ValueError(f'Failed to fetch lyrics: {song_id}')
|
||||||
if(lyrics['lyrics']['syncType'] == "UNSYNCED"):
|
if(lyrics['lyrics']['syncType'] == "UNSYNCED"):
|
||||||
with open(file_save, 'w') as file:
|
with open(file_save, 'w+', encoding='utf-8') as file:
|
||||||
for line in formatted_lyrics:
|
for line in formatted_lyrics:
|
||||||
file.writelines(line['words'] + '\n')
|
file.writelines(line['words'] + '\n')
|
||||||
return
|
return
|
||||||
elif(lyrics['lyrics']['syncType'] == "LINE_SYNCED"):
|
elif(lyrics['lyrics']['syncType'] == "LINE_SYNCED"):
|
||||||
with open(file_save, 'w') as file:
|
with open(file_save, 'w+', encoding='utf-8') as file:
|
||||||
for line in formatted_lyrics:
|
for line in formatted_lyrics:
|
||||||
timestamp = int(line['startTimeMs'])
|
timestamp = int(line['startTimeMs'])
|
||||||
ts_minutes = str(math.floor(timestamp / 60000)).zfill(2)
|
ts_minutes = str(math.floor(timestamp / 60000)).zfill(2)
|
||||||
|
|
Loading…
Reference in New Issue