diff options
author | ComradeCrow <comradecrow@vivaldi.net> | 2025-04-08 16:41:53 -0700 |
---|---|---|
committer | ComradeCrow <comradecrow@vivaldi.net> | 2025-04-08 16:41:53 -0700 |
commit | 5e16b7131c1fcdcf09b206a6359ab5750105eb6c (patch) | |
tree | f57cb01ecf3c1c03a4bd196e22c30ca95bdf0c33 /PodWeb.py | |
parent | 412d18a95da47c428ab65f4ba3b7a2553076d7f4 (diff) | |
download | podweb-5e16b7131c1fcdcf09b206a6359ab5750105eb6c.tar.gz |
edit win filenames
Diffstat (limited to 'PodWeb.py')
-rwxr-xr-x | PodWeb.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/PodWeb.py b/PodWeb.py index 3cd87d3..7026772 100755 --- a/PodWeb.py +++ b/PodWeb.py @@ -22,6 +22,8 @@ options = { os.path.join(os.path.expanduser("~/.config/podweb"), "serverlist") ), "downloadlocation": os.path.expanduser("~/Podcasts"), + "default_download_limit": -1, + "default_download_order": "ASC", } if os.name == "nt": @@ -55,6 +57,7 @@ class PodWeb: ## url: https://example.com/feed.xml ## img: https://example.com/image.jpg ## site: https://example.com +## autodownload: 10 ## - name: example podcast 2 ## url: example.com/feed2.xml @@ -181,6 +184,11 @@ class PodWeb: ) def _win_safe_filename(self, filename: str) -> str: + restricted_filenames = ["com", "prn", "aux", "nul"] + restricted_filenames += [F"com{i}" for i in range(0,10)] + restricted_filenames += [F"lpt{i}" for i in range(0,10)] + if filename.lower() not in restricted_filenames: + pass safe_chars = [" ", ".", "_"] return "".join( char for char in filename if char.isalnum() or char in safe_chars |