Small fixes V1.0.2
This commit is contained in:
@@ -22,6 +22,10 @@ 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():
|
||||||
|
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__))
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
DOWNLOADS = os.path.join(BASE_DIR, 'downloads')
|
DOWNLOADS = os.path.join(BASE_DIR, 'downloads')
|
||||||
os.makedirs(DOWNLOADS, exist_ok=True)
|
os.makedirs(DOWNLOADS, exist_ok=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user