diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index 67e1ff6..755c152 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -22,6 +22,10 @@ def rotate_downloads(downloads_dir: str): def download_video(yt_url: str) -> dict: MAX_DUR = os.getenv('MAX_DURATION') + if not MAX_DUR.isnumeric(): + return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} nie jest cyfrÄ….'} + + MAX_DUR = int(MAX_DUR) BASE_DIR = os.path.dirname(os.path.abspath(__file__)) DOWNLOADS = os.path.join(BASE_DIR, 'downloads') os.makedirs(DOWNLOADS, exist_ok=True)