douglas-watson / podcasts_export_app

Export Apple Podcasts for use on portable mp3 players
MIT License
28 stars 5 forks source link

export.py does not work with py 3.7 or 3.10 #7

Open sth0 opened 2 months ago

sth0 commented 2 months ago

When called with "% python3.10 export.py ./export/", get an error that "author" does not have the replace property.

Traceback (most recent call last): File "/Users/sth/Desktop/export.py", line 100, in export(get_downloaded_episodes(), output_dir) File "/Users/sth/Desktop/export.py", line 54, in export safe_author = author.replace('/', '|').replace(':', ',') AttributeError: 'NoneType' object has no attribute 'replace'

MacOS 14 Sonoma Mutagen version 1.4.7.0 installed using fink package manager. i mutagen-py310 1.47.0-1 Module to handle audio metadata

sth0 commented 2 months ago

The issue is that I have some very old podcasts where the Author field is blank. I added a single line #54 to create a blank author field. Same might need to be done for the podcast and/or the title field for robustness.

    safe_podcast = podcast.replace('/', '|').replace(':', ',')

++ if (author == None): author=" " safe_author = author.replace('/', '|').replace(':', ',')