Spaces:
Running
Running
Upload main.py with huggingface_hub
Browse files
main.py
CHANGED
|
@@ -514,8 +514,9 @@ def scrape_shorts():
|
|
| 514 |
except Exception as e:
|
| 515 |
print(f"scrape_shorts error: {e}")
|
| 516 |
|
| 517 |
-
#
|
| 518 |
-
if
|
|
|
|
| 519 |
cached = _cached("yt_shorts_fallback")
|
| 520 |
if cached:
|
| 521 |
return cached
|
|
|
|
| 514 |
except Exception as e:
|
| 515 |
print(f"scrape_shorts error: {e}")
|
| 516 |
|
| 517 |
+
# Cache successful result first - then fallback if needed
|
| 518 |
+
// Always use fallback if no videos - ensures homepage never breaks
|
| 519 |
+
if not vids:
|
| 520 |
cached = _cached("yt_shorts_fallback")
|
| 521 |
if cached:
|
| 522 |
return cached
|