Yetangitu / Spodcast

Spodcast is a caching Spotify podcast to RSS proxy. Using Spodcast you can follow Spotify-hosted netcasts/podcasts using any player which supports RSS, thus enabling the use of older hardware which is not compatible with the Spotify (web) app.
GNU General Public License v3.0
359 stars 14 forks source link

Include airing date in Episode title #21

Open BumbleCast opened 2 years ago

BumbleCast commented 2 years ago

Hi, first of all, thanks for the amazing script. Would it be possible to include the airing/release date in the filename?

e.g. Year-Month-Day - Name of podcast - title of episode

Would help alot to organize files.

edit: I looked at the code, and it could be done by changing the podcast file

and add in def get_episode_info(episode_id_hex): date_temp = datetime.strptime(release_date, '%Y-%m-%dT%H:%M:%SZ') release_date_clean = f'{date_temp.strftime("%Y")}-{date_temp.strftime("%m")}-{date_temp.strftime("%d")}' return podcast_name, podcast_id, duration_ms, episode_name, description, release_date, uri, external_url, release_date_clean

and in def download_episode(episode_id) -> None: filename = clean_filename(release_date_clean + ' - ' + podcast_name + ' - ' + episode_name)

(sorry, I am relatively new to github)

jankkm commented 2 years ago

This makes sense because there is a popular German podcast which doesn't have unique episode titles.

Your fix does work except you forgot to assign the additional return value.