diff --git a/lib/files.py b/lib/files.py index 76eac1d..788f7b5 100644 --- a/lib/files.py +++ b/lib/files.py @@ -32,7 +32,7 @@ def replaceExtension(fileName, newExtension): parts.pop() return '.'.join(parts) + '.' + newExtension -def saveEpisode(podcast, episode): +def saveEpisode(podcast, episode, options): match = startingNumerals.match(episode['title']) if episode['episode']: # Episode (& possibly season) number encoded in the RSS @@ -69,9 +69,10 @@ def saveEpisode(podcast, episode): episodeName += ' - ' + episode['subtitle'] episodeRef = getRef(episodeName) fileName = f"{episodeRef}.{ext}" - print(f"Downloading episode {identifier} of {podcast['name']} as {fileName}") + if options.verbose: + print(f"Downloading episode {identifier} of {podcast['name']} as {fileName}") fetcher.download(episode['url'], f"{podcast['dir']}/{fileName}") - else: + elif options.verbose: print(f"Episode {identifier} of {podcast['name']} has been downloaded previously; skipping") def findAudio(): diff --git a/process b/process index 4dad37c..c8b3286 100755 --- a/process +++ b/process @@ -16,7 +16,7 @@ for podcast in config['podcasts']: if options.downloadEpisodes: eps = rss.getEpisodes(podcast, options.episodes, options.numEpisodes) for ep in eps: - files.saveEpisode(podcast, ep) + files.saveEpisode(podcast, ep, options) if not options.generate: exit(0)