FarhadMadadzade
commited on
Commit
•
042a04d
1
Parent(s):
4c56b36
added date format validation
Browse files
app.py
CHANGED
@@ -13,6 +13,9 @@ pipe = pipeline("automatic-speech-recognition", model="Artanis1551/whisper_swedi
|
|
13 |
|
14 |
|
15 |
def process_video1(date):
|
|
|
|
|
|
|
16 |
try:
|
17 |
video_path = download_video1(date)
|
18 |
|
|
|
13 |
|
14 |
|
15 |
def process_video1(date):
|
16 |
+
# If the date is not in YYYY-MM-DD format, return an error message
|
17 |
+
if not date or len(date) != 10 or date[4] != "-" or date[7] != "-":
|
18 |
+
return "", "Please enter a date in the format YYYY-MM-DD."
|
19 |
try:
|
20 |
video_path = download_video1(date)
|
21 |
|