mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2025-07-01 15:23:15 +00: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/" +
|
info = json.loads(requests.get("https://api.spotify.com/v1/episodes/" +
|
||||||
episode_id_str, headers={"Authorization": "Bearer %s" % token}).text)
|
episode_id_str, headers={"Authorization": "Bearer %s" % token}).text)
|
||||||
|
|
||||||
|
if "error" in info:
|
||||||
|
return None, None
|
||||||
|
else:
|
||||||
return info["show"]["name"], info["name"]
|
return info["show"]["name"], info["name"]
|
||||||
|
|
||||||
|
|
||||||
@ -189,6 +192,9 @@ def downloadEpisode(episode_id_str):
|
|||||||
global ROOT_PODCAST_PATH
|
global ROOT_PODCAST_PATH
|
||||||
|
|
||||||
podcastName, episodeName = getEpisodeInfo(episode_id_str)
|
podcastName, episodeName = getEpisodeInfo(episode_id_str)
|
||||||
|
if podcastName == None:
|
||||||
|
print("### SKIPPING: (EPISODE NOT FOUND) ###")
|
||||||
|
else:
|
||||||
filename = podcastName + " - " + episodeName + ".wav"
|
filename = podcastName + " - " + episodeName + ".wav"
|
||||||
|
|
||||||
episode_id = EpisodeId.from_base62(episode_id_str)
|
episode_id = EpisodeId.from_base62(episode_id_str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user