bep40 commited on
Commit
81ec5f2
·
verified ·
1 Parent(s): 13f2220

Upload main.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -514,8 +514,9 @@ def scrape_shorts():
514
  except Exception as e:
515
  print(f"scrape_shorts error: {e}")
516
 
517
- # Fallback to cache or static fallback if scrape fails
518
- if not vids:
 
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