From d342f42290d1971d506ac2161f5224815c626eef Mon Sep 17 00:00:00 2001 From: relikd Date: Wed, 15 Oct 2025 18:20:11 +0200 Subject: [PATCH] fix: extension + file permissions --- botlib/__init__.py | 0 botlib/cli.py | 0 botlib/cron.py | 0 botlib/curl.py | 4 +++- botlib/helper.py | 0 botlib/oncedb.py | 0 botlib/tgclient.py | 0 7 files changed, 3 insertions(+), 1 deletion(-) mode change 100755 => 100644 botlib/__init__.py mode change 100755 => 100644 botlib/cli.py mode change 100755 => 100644 botlib/cron.py mode change 100755 => 100644 botlib/curl.py mode change 100755 => 100644 botlib/helper.py mode change 100755 => 100644 botlib/oncedb.py mode change 100755 => 100644 botlib/tgclient.py diff --git a/botlib/__init__.py b/botlib/__init__.py old mode 100755 new mode 100644 diff --git a/botlib/cli.py b/botlib/cli.py old mode 100755 new mode 100644 diff --git a/botlib/cron.py b/botlib/cron.py old mode 100755 new mode 100644 diff --git a/botlib/curl.py b/botlib/curl.py old mode 100755 new mode 100644 index 0561267..9ce4967 --- a/botlib/curl.py +++ b/botlib/curl.py @@ -184,7 +184,9 @@ class Curl: if not parts: raise URLError('URL not valid: "{}"'.format(url_str)) - ext = parts.path.split('.')[-1] or 'unknown' + ext = parts.path.split('.')[-1] + if not ext or len(ext) > 4: + ext = 'unknown' file_path = os.path.join(dest_dir, fname + '.' + ext) if override or not os.path.isfile(file_path): url = parts.geturl() diff --git a/botlib/helper.py b/botlib/helper.py old mode 100755 new mode 100644 diff --git a/botlib/oncedb.py b/botlib/oncedb.py old mode 100755 new mode 100644 diff --git a/botlib/tgclient.py b/botlib/tgclient.py old mode 100755 new mode 100644