Send cached V1.0.8
This commit is contained in:
@@ -36,11 +36,12 @@ def download_video(yt_url: str) -> dict:
|
||||
|
||||
existing = [f for f in os.listdir(DOWNLOADS) if url_hash in f]
|
||||
if existing:
|
||||
print(f'Znaleziono plik "{url_hash}" ({yt_url})')
|
||||
print(f'Znaleziono plik "{existing[0]}" ({yt_url})')
|
||||
return {
|
||||
"status": "success",
|
||||
"filename": os.path.join(DOWNLOADS, existing[0]),
|
||||
"cached": True,
|
||||
'status': 'success',
|
||||
'filename': os.path.join(DOWNLOADS, existing[0]),
|
||||
'title': {existing[0]},
|
||||
'cached': True,
|
||||
}
|
||||
|
||||
with yt_dlp.YoutubeDL({'quiet': True}) as ydl:
|
||||
@@ -65,7 +66,6 @@ def download_video(yt_url: str) -> dict:
|
||||
'format': 'bestvideo+bestaudio/best',
|
||||
'merge_output_format': 'mp4',
|
||||
'outtmpl': os.path.join(DOWNLOADS, f'%(title)s_{url_hash}.%(ext)s'),
|
||||
"no_overwrites": True,
|
||||
'quiet': True,
|
||||
}
|
||||
|
||||
@@ -83,5 +83,6 @@ def download_video(yt_url: str) -> dict:
|
||||
'filename': filename,
|
||||
'title': info.get('title'),
|
||||
'duration': duration,
|
||||
'cached': False,
|
||||
'url': yt_url,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user