Spaces:
Sleeping
Sleeping
Sasha commited on
Commit ·
91ae573
1
Parent(s): f26efec
fix: date parsing format for Whisper sync
Browse files
local_worker/vod_backfiller.py
CHANGED
|
@@ -240,7 +240,15 @@ def transcribe_vod_audio(vod_id, start_time_iso, model, start_offset=0, end_offs
|
|
| 240 |
|
| 241 |
offset_seconds = start_offset
|
| 242 |
|
| 243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
while True:
|
| 246 |
if end_offset is not None and offset_seconds >= end_offset:
|
|
|
|
| 240 |
|
| 241 |
offset_seconds = start_offset
|
| 242 |
|
| 243 |
+
try:
|
| 244 |
+
from datetime import datetime
|
| 245 |
+
clean_str = start_time_iso.replace('Z', '+00:00')
|
| 246 |
+
base_start_time = datetime.fromisoformat(clean_str).timestamp()
|
| 247 |
+
except Exception as parse_e:
|
| 248 |
+
print(f"[Audio] Error parsing start_time_iso '{start_time_iso}': {parse_e}")
|
| 249 |
+
# Fallback to seconds-only precision
|
| 250 |
+
clean_t = start_time_iso.split(".")[0].replace("Z", "").replace("+00:00", "")
|
| 251 |
+
base_start_time = time.mktime(time.strptime(clean_t, "%Y-%m-%dT%H:%M:%S"))
|
| 252 |
|
| 253 |
while True:
|
| 254 |
if end_offset is not None and offset_seconds >= end_offset:
|