Ruperth commited on
Commit
46490f6
·
1 Parent(s): 7ba2f95

feat: fetch 50 newest youtube comments per video sorted by time

Browse files
configs/suggested_videos.yaml CHANGED
@@ -2,7 +2,7 @@
2
  # max_comments: cap for /predict-video when a rail video is selected.
3
  # Default player embed (no comments until you pick a rail video): frontend/src/pages/WatchPage.tsx → DEFAULT_EMBED_VIDEO_ID
4
  # Prefer embed-friendly videos with comments enabled (avoid Vevo music IDs).
5
- max_comments: 15
6
 
7
  videos:
8
  - id: jNQXAC9IVRw
 
2
  # max_comments: cap for /predict-video when a rail video is selected.
3
  # Default player embed (no comments until you pick a rail video): frontend/src/pages/WatchPage.tsx → DEFAULT_EMBED_VIDEO_ID
4
  # Prefer embed-friendly videos with comments enabled (avoid Vevo music IDs).
5
+ max_comments: 50
6
 
7
  videos:
8
  - id: jNQXAC9IVRw
src/api/youtube.py CHANGED
@@ -93,6 +93,7 @@ def _fetch_via_api(
93
  maxResults=min(100, max_comments - len(comments)),
94
  pageToken=page_token,
95
  textFormat="plainText",
 
96
  )
97
  .execute()
98
  )
 
93
  maxResults=min(100, max_comments - len(comments)),
94
  pageToken=page_token,
95
  textFormat="plainText",
96
+ order="time", # newest first
97
  )
98
  .execute()
99
  )