Skip to content

Commit a28ad79

Browse files
feat: add standalone YouTube database update script
Agent-Logs-Url: https://github.com/GalvinPython/feedr/sessions/fe3d0359-7e36-46f1-b3d4-8cbec9d51594 Co-authored-by: GalvinPython <77013913+GalvinPython@users.noreply.github.com>
1 parent 5107adb commit a28ad79

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
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+
"update:youtube": "bun src/updateYouTube.ts",
4243
"start:web": "cd web && bun start"
4344
},
4445
"dependencies": {

src/updateYouTube.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
await fetchLatestUploads();
11+
12+
console.log("YouTube database update complete.");
13+
14+
process.exit(0);

0 commit comments

Comments
 (0)