Spodcast v0.5.0 which:

- fixes #13 (Cannot download episodes anymore)
 - uses _librespot-python_ interfaces instead of raw web API access (needed to fix #13)
 - can not yet determine decrypted file size for Spotify-hosted episodes (which used to work) so will only look at the file name to determine whether an episode has already been downloaded. To retry corrupted downloads just remove the partially downloaded file and try again.
This commit is contained in:
Frank de Lange 2022-06-30 16:52:41 +00:00
parent c0f76f5290
commit 0877f04cb1
8 changed files with 143 additions and 152 deletions

View file

@ -5,6 +5,7 @@ from enum import Enum
from typing import List, Tuple
from spodcast.spodcast import Spodcast
from spodcast.const import OPEN_SPOTIFY_URL
valid_filename_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
@ -47,3 +48,6 @@ def clean_filename(filename, whitelist=valid_filename_chars, replace=' '):
cleaned_filename = ''.join(c for c in cleaned_filename if c in whitelist)
return cleaned_filename
def uri_to_url(spotify_id):
(spotify,sp_type,sp_id) = spotify_id.split(':')
return f'https://{OPEN_SPOTIFY_URL}/{sp_type}/{sp_id}'