Small fixes V1.0.4
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import discord
|
import discord
|
||||||
|
|
||||||
__version__ = '1.0.3'
|
__version__ = '1.0.4'
|
||||||
__author__ = 'Kartoniarz'
|
__author__ = 'Kartoniarz'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import hashlib
|
|||||||
|
|
||||||
def rotate_downloads(downloads_dir: str):
|
def rotate_downloads(downloads_dir: str):
|
||||||
MAX_FILES = os.getenv('MAX_FILES')
|
MAX_FILES = os.getenv('MAX_FILES')
|
||||||
|
if not MAX_FILES.isnumeric():
|
||||||
|
return {'status': 'error', 'message': f'MAX_FILES: {MAX_FILES} - nie jest cyfrą.'}
|
||||||
|
|
||||||
|
MAX_FILES = int(MAX_FILES)
|
||||||
files = [
|
files = [
|
||||||
os.path.join(downloads_dir, f)
|
os.path.join(downloads_dir, f)
|
||||||
for f in os.listdir(downloads_dir)
|
for f in os.listdir(downloads_dir)
|
||||||
@@ -23,7 +26,7 @@ def rotate_downloads(downloads_dir: str):
|
|||||||
def download_video(yt_url: str) -> dict:
|
def download_video(yt_url: str) -> dict:
|
||||||
MAX_DUR = os.getenv('MAX_DURATION')
|
MAX_DUR = os.getenv('MAX_DURATION')
|
||||||
if not MAX_DUR.isnumeric():
|
if not MAX_DUR.isnumeric():
|
||||||
return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} nie jest cyfrą.'}
|
return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} - nie jest cyfrą.'}
|
||||||
|
|
||||||
MAX_DUR = int(MAX_DUR)
|
MAX_DUR = int(MAX_DUR)
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|||||||
Reference in New Issue
Block a user