mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2024-11-26 18:03:17 +01:00
Improved podcast downloading
This commit is contained in:
parent
5838ea0ce1
commit
6c260e25ff
@ -182,6 +182,9 @@ def getEpisodeInfo(episode_id_str):
|
||||
info = json.loads(requests.get("https://api.spotify.com/v1/episodes/" +
|
||||
episode_id_str, headers={"Authorization": "Bearer %s" % token}).text)
|
||||
|
||||
if "error" in info:
|
||||
return None, None
|
||||
else:
|
||||
return info["show"]["name"], info["name"]
|
||||
|
||||
|
||||
@ -189,6 +192,9 @@ def downloadEpisode(episode_id_str):
|
||||
global ROOT_PODCAST_PATH
|
||||
|
||||
podcastName, episodeName = getEpisodeInfo(episode_id_str)
|
||||
if podcastName == None:
|
||||
print("### SKIPPING: (EPISODE NOT FOUND) ###")
|
||||
else:
|
||||
filename = podcastName + " - " + episodeName + ".wav"
|
||||
|
||||
episode_id = EpisodeId.from_base62(episode_id_str)
|
||||
|
Loading…
Reference in New Issue
Block a user