File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 "web:build" : " cd web && bun build" ,
4040 "start:api" : " echo 'Cannot start API without cargo. Reserved for future use' && exit 1" ,
4141 "start:bot" : " bun run src/bot.ts" ,
42- "start:web" : " cd web && bun start"
42+ "start:web" : " cd web && bun start" ,
43+ "update:youtube" : " bun src/updateYouTube.ts"
4344 },
4445 "dependencies" : {
4546 "cron" : " ^4.3.0" ,
Original file line number Diff line number Diff line change 1+ import { env } from "./config.ts" ;
2+ import fetchLatestUploads from "./utils/youtube/fetchLatestUploads.ts" ;
3+
4+ if ( ! env . youtubeApiKey || env . youtubeApiKey === "YOUR_YOUTUBE_API_KEY" ) {
5+ throw new Error ( "You MUST provide a YouTube API key in .env!" ) ;
6+ }
7+
8+ console . log ( "Starting standalone YouTube database update..." ) ;
9+
10+ const updateSucceeded = await fetchLatestUploads ( ) ;
11+
12+ if ( updateSucceeded === true ) {
13+ console . log ( "YouTube database update complete." ) ;
14+ process . exit ( 0 ) ;
15+ }
16+
17+ console . error ( "YouTube database update failed." ) ;
18+ process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments