Skip to content

Commit

Permalink
add check for empty list before downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudauu authored and phuongnt committed Feb 11, 2024
1 parent 43cd435 commit ba33fdd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ def generate():
video_urls.append(url)
break

# Check if video_urls is empty
if not video_urls:
print(colored("[-] No videos found to download.", "red"))
return jsonify(
{
"status": "error",
"message": "No videos found to download.",
"data": [],
}
)

# Define video_paths
video_paths = []

Expand Down

0 comments on commit ba33fdd

Please sign in to comment.