Added option to override file names (fix for brtmr/podfox#20)#21
Added option to override file names (fix for brtmr/podfox#20)#21antfred wants to merge 34 commits intobrtmr:masterfrom
Conversation
take filename from content-disposition header if present
* Added option to override file names Some podcasts provide always the same filename, or meaningless file names. I added an option --rename-files to the episodes download function so that filenames are generated per episode using the schema: %Y-%m-%d_<title>.<ext> In addition, the title gets stripped of characters which would be illegal in some filesystems to prevent issues
* Added option to override file names Some podcasts provide always the same filename, or meaningless file names. I added an option --rename-files to the episodes download function so that filenames are generated per episode using the schema: %Y-%m-%d_<title>.<ext> In addition, the title gets stripped of characters which would be illegal in some filesystems to prevent issues
Bumps [requests](https://github.com/requests/requests) from 2.11.1 to 2.20.0. - [Release notes](https://github.com/requests/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](psf/requests@v2.11.1...v2.20.0) Signed-off-by: dependabot[bot] <support@github.com>
Sorry, I have not updated this project in a while. merged.
Bump requests from 2.11.1 to 2.20.0, to make dependabot happy.
Add default configuration
|
Would love if this change could get merged into podfox. Podfox does exactly what I need, except for the odd podcast where each episode is named "stream.mp3". Thanks in advance for considering an update to the functionality of your utility! |
Added mimetype "audio/x-mpeg" and check for troubling or missing publishing date
Add ability to prune old episodes via prune command. Max age in days can be set via configuration or passed in via command line. This requires tracking of the filename used to store the podcast episode, so this has been added to the feed json. Pulling the filename out of the url can be used as a fallback; however, if the name has been pulled out of the HTTP headers, then this feature will not be backwards compatible for episodes named in this way and thus those will not be pruned.
|
This is a good PR. I've started using this in conjunction with the prune PR I made #43. This makes it very easy for those of us who have podcasts on our network being shared via samba, nfs, or upnp so we can easily see what episode it actually is. |
Python3.9 removes the `base64.encodingstring` and `base64.decodestring` after being deprecated in an earlier version. Update feedparser to a version that doesn't reference these functions so that we don't crash on python3.9.
|
Has this PR/project been abandoned? This PR from 2018 is just what I'm looking for for this weird subscription-based feed I have. |
Looks good to me!
Allow usage of later versions of feedparser
Update feedparser version for py39
| docopt==0.6.2 | ||
| feedparser==5.2.1 | ||
| requests==2.20.0 | ||
| tqdm=4.48.2 No newline at end of file |
There was a problem hiding this comment.
tqdm needs adding to the setup.py too.
There was a problem hiding this comment.
Thanks, I merged the latest version from brtmr:master including this change, it should be good now!
- Remove unused top-level mimetypes list - Fix timezone bug in episode_too_old: use utcfromtimestamp instead of fromtimestamp - Extract _make_feed_folder helper to deduplicate folder creation logic in import_feed - Replace O(n²) nested loop in update_feed with O(1) set-based deduplication - Remove redundant hasattr check in episodes_from_feed - Replace bare except with specific (KeyError, IndexError) in download_single - Fix Content-Length KeyError in download_single by using headers.get with fallback - Fix rename crash: call find_feed before os.rename so the feed file can still be found - Guard against empty episode list in pretty_print_feeds - Add missing exit(0) after rename command in main Co-authored-by: Antonio Frediani <antfred@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Thanks a lot for your project, it is exactly what I was looking for!
Some podcasts provide always the same filename, or the file names are gibberish, see #20. I added a new option when downloading the episodes
(--rename-files) so that filenames are generated per episode using the schema:
%Y-%m-%d_<title>.
In addition, the title gets stripped of characters which would be illegal in some filesystems to prevent issues
It is probably not the most pytonic code but it seems to me to do its job, glad if I can give back to some users.