YouTube Board

Ingestion Scheduler

Web request gates scheduler disabled local polling disabled

Web Request Gates

scheduler disabled local polling disabled scheduled write allowlist 0

These gates describe this web request only. Dokploy scheduled tasks may inject separate env flags for their one-shot CLI process without enabling polling for normal web traffic.

External Scheduler Activity

external scheduler active window 3 minutes

latest=2026-05-26 08:35:00 Asia/Taipei age=54.64172s evaluated=25 due=6 executed=6 skipped=0 failed=0

25 jobs 0 planned 25 active 0 blocked 25 command-ready 0 command-missing timezone Asia/Taipei dry-run php artisan ingestion:run

One-shot Runner

Execute mode temporarily enables the local runner for this request only. Local write polling still requires INGESTION_LOCAL_POLLING_ENABLED=true, an allowlisted job key, and each job's capped scheduled execute command.

Latest One-shot Runs

Created Mode Job Evaluated Due Executed Skipped Failed File
2026-05-26 08:35:00 Asia/Taipei execute all due jobs 25 6 6 0 0 ingestion-runs/20260526-083500-2553baf8-35ee-4b29-b36d-aa7e3139d290.json
2026-05-26 08:34:00 Asia/Taipei execute all due jobs 25 2 2 0 0 ingestion-runs/20260526-083400-ae645176-3249-4ca7-a558-46fcf2360e76.json
2026-05-26 08:33:00 Asia/Taipei execute all due jobs 25 2 2 0 0 ingestion-runs/20260526-083300-cffadd0c-5860-473f-a320-436ad6845a96.json
2026-05-26 08:32:00 Asia/Taipei execute all due jobs 25 2 2 0 0 ingestion-runs/20260526-083200-3743f0a8-01dc-46ed-a363-1962544688c1.json
2026-05-26 08:31:00 Asia/Taipei execute all due jobs 25 3 3 0 0 ingestion-runs/20260526-083100-470f78eb-f4d1-4837-a39b-14976b84b10d.json
2026-05-26 08:30:00 Asia/Taipei execute all due jobs 25 4 4 0 0 ingestion-runs/20260526-083000-c04fd12b-a474-460b-b506-e3ead203ae8f.json
2026-05-26 08:29:00 Asia/Taipei execute all due jobs 25 3 3 0 0 ingestion-runs/20260526-082900-48adf1e9-2855-4f50-98d5-8c21110b4992.json
2026-05-26 08:28:00 Asia/Taipei execute all due jobs 25 4 4 0 0 ingestion-runs/20260526-082800-2af7e39e-4556-435e-9598-591f573ee019.json

Live polling

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
1 active youtube:live:cleanup
youtube.live.cleanup
detail / next runs
ready /usr/bin/php /home/urtube/maint/unlist_live.php 27 */2 * * *
每 2 小時第 27 分
Local DB
none (read-only stale live cleanup preview)
Legacy 會把過久未更新、尚未結束且排程時間已過的 `urt_video_live` row 設為 `del_flag=1`;目前 modern command 只列出 would-mark rows,不呼叫 YouTube、不更新 `del_flag`。
1 active youtube:live:poll
youtube.live.poll
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_live.php * * * * *
每分鐘
Local DB
none (read-only live polling queue preview)
Legacy 從 `urt_video_live` 挑 `mtime` 超過 interval、尚未結束、排程時間已到且未刪除的直播 row;少於 10 筆且未指定 `videoId` 時會直接離開,否則呼叫 YouTube `videos.list(liveStreamingDetails)` 更新 `urt_video_live` 並 upsert `urt_video_live_log.log_json`。Modern command 預設仍只列出 would-poll rows;manual local-only `--execute --videoId/--limit` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally 更新本機 `urt_video_live` 與 `urt_video_live_log`。Scheduler 不傳 `--execute`,仍是 dry-run。
1 active youtube:tvbs:live:poll
youtube.tvbs.live.poll
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_live_tvbs.php * * * * *
每分鐘 read-only preview;legacy file 本身是 while(1) + sleep(30),未列在目前 cron snapshot
Local DB
none (read-only TVBS live polling queue preview)
Legacy TVBS poller 從 `urt_video_live_tvbs` 挑 `mtime` 超過硬編碼 40 秒、尚未結束、排程時間已到且未刪除的直播 row,呼叫 YouTube `videos.list(liveStreamingDetails)` 後更新 `urt_video_live_tvbs` 並 upsert `urt_video_live_log_tvbs.log_json`。Modern command 預設仍只列出 would-poll rows;manual local-only `--execute --videoId/--limit` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally 更新本機 `urt_video_live_tvbs` 與 `urt_video_live_log_tvbs`。Scheduler 不傳 `--execute`,仍是 dry-run。`videoId` branch 在 legacy source 意外查 `urt_video_live`,modern implementation 保持 TVBS table scope 並記錄 compatibility note。

Live reports

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
1 active reports:live:build
reports.live.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_live.php */9 0-9,15,23 * * * / */19 10-14 * * *
依時段每 9 或 19 分鐘
Local DB
none (read-only display-cache preview)
Legacy `make_live.php` 會呼叫 YouTube API 補 `urt_video` / `urt_video_live`,`show_live.php` 會寫 `urt_show_video_live` cache;目前 modern command 只用本機 `urt_video_live` + `urt_video` 預覽會補哪些 display cache rows,不呼叫 YouTube、不寫 cache。
1 active reports:live:clean
reports.live.clean
detail / next runs
ready /usr/bin/php /home/urtube/maint/clean_show_live.php 33 3,13,23 * * *
03:33、13:33、23:33
Local DB
none (read-only live tag-date cleanup preview)
Legacy 會刪除 `urt_show_live_tag_date` 中 `the_date` 太接近 cache `ctime` 的 row;目前 modern command 只列出 would-delete rows,不刪 cache row。
1 active reports:live:show
reports.live.show
detail / next runs
ready /usr/bin/php /home/urtube/maint/show_live.php */7 * * * *
每 7 分鐘
Local DB
none (read-only snapshot)
Legacy 會寫 `urt_show_video_live` cache;目前 modern command 只輸出本機 read-only snapshot,不寫 cache,可作為 scheduler one-shot 驗證目標。
1 active reports:live:static
reports.live.static
detail / next runs
ready /home/urtube/html/make_live.sh */19 * * * *
每 19 分鐘
Local DB
none (read-only live static HTML preview)
Legacy 會執行 `live.php or=1,2,12,13,14,81 > html/live_social.html`;目前 modern command 只列出 would-generate target 並對應到 `/live/current?or=1,2,12,13,14,81`,不覆寫 HTML 檔。

Video discovery

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
2 active youtube:channels:videos
youtube.channels.videos.general
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video.php */5 * * * *
每 5 分鐘
Local DB
none by default; manual local-only `--execute` inserts videos/schedules/live rows
Legacy 會挑 `urt_channel.vtime` 到期或 NULL 的頻道,先把 `vtime` 推到一小時後,再呼叫 YouTube `playlistItems.list(snippet)` 抓 uploads playlist,insert `urt_video`、`urt_video_schedule`,live/upcoming 時 insert `urt_video_live`,最後依近七天影片數估算下一次 `vtime`。Modern command 預設仍只列出 would-fetch channels 和本地估算;manual local-only `--execute --id/--channel --limit --max-results` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,idempotently upsert 本機 `urt_video`、`urt_video_schedule`、`urt_video_live` 並更新 `urt_channel.vtime`。Scheduler 不傳 `--execute`,仍是 dry-run。
2 active youtube:channels:videos --live=1 --force=3
youtube.channels.videos.live
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video.php live=1 force=3 5 2-16 * * *
02-16 點每小時第 5 分
Local DB
none by default; manual local-only `--execute` inserts videos/schedules/live rows
Legacy 會從 `urt_count.tags` 找 `[52]` 直播頻道,呼叫 YouTube `playlistItems.list(snippet)` 抓 uploads playlist,insert `urt_video`、`urt_video_schedule`,並在 live/upcoming 時 insert `urt_video_live`。Modern command 預設仍只列出 would-fetch channels;manual local-only `--execute --id/--channel --limit --max-results` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,idempotently upsert 本機 `urt_video`、`urt_video_schedule`、`urt_video_live` 並更新 `urt_channel.vtime`。Scheduler 不傳 `--execute`,仍是 dry-run。
2 active youtube:channels:videos --live=2 --force=3
youtube.channels.videos.live_group
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video.php live=2 force=3 1,31 0-15 * * *
00-15 點每小時第 1、31 分
Local DB
none by default; manual local-only `--execute` inserts videos/schedules/live rows
Legacy 會從 `urt_count.tags` 找 `[89]` 群組頻道,呼叫 YouTube `playlistItems.list(snippet)` 抓 uploads playlist,insert `urt_video`、`urt_video_schedule`,並在 live/upcoming 時 insert `urt_video_live`。Modern command 預設仍只列出 would-fetch channels;manual local-only `--execute --id/--channel --limit --max-results` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,idempotently upsert 本機 `urt_video`、`urt_video_schedule`、`urt_video_live` 並更新 `urt_channel.vtime`。Scheduler 不傳 `--execute`,仍是 dry-run。
2 active youtube:tvbs:videos
youtube.tvbs.videos
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video_tvbs.php */5 * * * *
每 5 分鐘 read-only preview;legacy file 本身是 while loop + sleep(300),未列在目前 cron snapshot
Local DB
none by default; manual local-only `--execute` inserts videos/schedules/TVBS live rows
Legacy TVBS discovery 從 `urt_count.tags` 找 `[29]` 頻道,逐一呼叫 YouTube `playlistItems.list(snippet)` 抓 uploads playlist,insert `urt_video`、`urt_video_schedule`,並在縮圖含 `default_live.jpg` 或 live/upcoming 時 insert `urt_video_live_tvbs`。Modern command 預設仍只列出 would-fetch channels;manual local-only `--execute --id/--channel --limit --max-results` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,idempotently upsert 本機 `urt_video` / `urt_video_schedule` / `urt_video_live_tvbs`。Scheduler 不傳 `--execute`,仍是 dry-run。

Video polling

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
2 active youtube:videos:stats
youtube.videos.stats
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video_count.php */7 0-17 * * *
00-17 點每 7 分鐘
Local DB
none by default; manual local-only `--execute` updates video stats/log rows
Legacy 從 `urt_video_schedule` 挑 `stime` 到期且 210 天內發布的影片,先把 `stime` 推到未來,再呼叫 YouTube `videos.list(statistics)` 並更新 `urt_video`、`urt_video_schedule`、`urt_video_log`、`urt_video_log_history`。Modern command 預設仍只列出 would-refresh candidates;manual local-only `--execute --videoId/--limit` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally/idempotently upsert 本機 stats/log rows。Scheduler 不傳 `--execute`,仍是 dry-run。
3 active youtube:videos:duration
youtube.videos.duration
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_duration.php */23 * * * *
每 23 分鐘
Local DB
none by default; manual local-only `--execute` updates duration queue rows
Legacy 從 `urt_video_duration` queue 挑 `mtime/duration/stime` 皆為 NULL 的 row,先把 `stime` 推到未來,再呼叫 YouTube `videos.list(contentDetails)` 並更新 `duration/caption`。Modern command 預設仍只列出 queue candidates 和 missing queue diagnostics;manual local-only `--execute --videoId/--limit` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally/idempotently 更新本機 `urt_video_duration`。需要補 queue row 時必須額外明確傳 `--enqueue-missing`。Scheduler 不傳 `--execute`,仍是 dry-run。

YouTube polling

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
2 active youtube:channels:stats
youtube.channels.stats
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_statics.php */9 * * * *
每 9 分鐘
Local DB
none by default; manual local-only `--execute` updates channel/count/log rows
Legacy 從 `urt_channel` 挑 `stime` 過期或 NULL 的頻道,23 點只補 NULL,先更新 `urt_channel.stime`,再呼叫 YouTube `channels.list(statistics)` 並更新 `urt_log`、`urt_count`、`urt_channel`。Modern command 預設仍只列出 would-refresh channels;manual local-only `--execute --u_id/--channel --limit` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally/idempotently 更新本機 `urt_channel`、`urt_count`、`urt_log`。Scheduler 不傳 `--execute`,仍是 dry-run。

Derived reports

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
3 active reports:counts:build
reports.counts.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_count.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
none (read-only count-delta preview)
Legacy 會根據 `urt_log.thedata` update `urt_count` 的週/月 view/sub/video 增量;目前 modern command 只輸出本機 read-only preview,不更新 `urt_count`。
3 active reports:groups:build
reports.groups.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_group.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB (tag.analysis.tw fetch skipped)
none (read-only tag_group sync preview)
Legacy 會呼叫 `https://tag.analysis.tw/api/group.php?hours=...`,再 insert/update `tag_group`;目前 modern command 只彙整本機 `tag_group` 狀態,不打外部服務、不更新 DB。
3 active reports:keywords:build
reports.keywords.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_keyword.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
none (read-only keyword JSON preview)
Legacy 會從 `tag.analysis.tw` 抓 tag JSON、更新 `tags`,再寫 `data/keyword.json` / `data/keyword_all.json`;目前 modern command 只用本機 `tags` 預覽 keyword JSON,不打外部 API、不寫檔案、不更新 DB。
3 active reports:people:build
reports.people.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_people.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
none (read-only people period preview)
Legacy 從 `tag_group` 找 `政治人物`,逐一呼叫 `api/tag_period.php tag=... tagid=13 days=37` 產生 cache;目前 modern command 只列出會處理的 tag period jobs,不呼叫 API、不生成 cache、不寫 DB。
3 active reports:schedule:build
reports.schedule.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_schedule.php 29,47 * * * *
每小時第 29、47 分
Local DB
none (read-only schedule stime preview)
Legacy 讀最近更新的 `urt_video_schedule`,用 `urt_video_log_history` 最近兩筆觀看數估算下一次 `stime`,再更新 `urt_video_schedule.stime/mtime`;目前 modern command 只輸出估算結果,不更新 schedule row。

AI summaries

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
4 active ai:daily
ai.daily
detail / next runs
ready /home/urtube/maint/make_ai_day.sh 15 16 * * *
每日 16:15
Local DB
none (read-only daily AI prompt/run preview)
Legacy 先執行 `make_channel_ai.php` 更新指定頻道的 `urt_channel_ai`,再用 `get_ai_day.php condition=all/green/blue/neutral/finance/world` 呼叫 AI 並 insert `urt_ai_date`;目前 modern command 只預覽 channel AI refresh 候選、daily prompt merge row counts 和 would-write rows,不呼叫 AI、不新增 `urt_channel_ai`、不新增 `urt_ai_date`。
4 active ai:hourly
ai.hourly
detail / next runs
ready /usr/bin/php /home/urtube/prompt/ai_hour_prompt.php do=1 10 0-15 * * *
00-15 點每小時第 10 分
Local DB
none by default; explicit `--execute` calls OpenCode-compatible chat completions and upserts `urt_ai_hour`
Legacy 在每小時第 10 分用 `ai_hour_prompt.php do=1` 抓上一個完整小時的 `urt_video`,套用 condition/tag filters,呼叫 AI 後 insert `urt_ai_hour` 且 `data_type=each`;modern command 預設仍只預覽影片候選、prompt bounds、既有 hourly row。Explicit `--execute` 會檢查 OpenCode-compatible key、呼叫 chat completions,並以 date window / condition / model / data_type / user_token idempotently upsert `urt_ai_hour`。Scheduler scheduled write 只在 scheduler、local/production polling、allowlist gates 通過後使用 capped execute command。

Static reports

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
4 active reports:mayor:static
reports.mayor.static
detail / next runs
ready /home/urtube/mayor/make_mayor.sh 13 */5 * * *
每 5 小時第 13 分 read-only preview;目前 legacy cron snapshot 這行是註解狀態
Local DB
none (read-only mayor static HTML preview)
Legacy `mayor/make_mayor.sh` 會執行 `mayor/city.php days=30 city=...` 並覆寫 `/home/urtube/mayor/html_*.html`;目前 modern command 只列出 would-generate target 並對應到 `/mayor/cities/{city}`,不呼叫 `api/cloud_tag_date.php`、不覆寫 HTML 檔。
4 active reports:static:build
reports.static.html
detail / next runs
ready /home/urtube/html/make_html.sh 13 8 * * *
每日 08:13
Local DB
none (read-only group static HTML preview)
Legacy 會執行 `group_chart.php` / `group_line.php` 並覆寫 `html/group_*.html`;目前 modern command 只列出 would-generate target 並對應到 `/groups/{group}/ranking` 或 `/groups/{group}/trends`,不覆寫 HTML 檔。

Comments

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
5 active youtube:comments:fetch
youtube.comments.fetch
detail / next runs
ready /usr/bin/php /home/urtube/maint/do_comments.php 5 * * * *
每小時第 5 分
Local DB; YouTube Data API commentThreads.list only with manual `--execute`
none by default; manual local-only `--execute` updates comments/authors/revisions and moves queue rows
Legacy 逐筆讀 `urt_comment_queue`,先更新 `stime`,呼叫 `maint/get_comment.php videoId=...` 抓 YouTube `commentThreads.list` 並更新 `urt_comment` / `urt_comment_author` / `urt_comment_rev`,再更新 `ftime`、copy 到 `urt_comment_queue_done`、delete queue row。Modern command 預設仍只列出 would-drain rows 和三小時快取判斷;manual local-only `--execute --videoId/--limit --max-pages` 會檢查 `YOUTUBE_API_KEY` 後限量呼叫 YouTube,transactionally 更新本機 comment/author/revision tables 並搬移 queue row。Scheduler 不傳 `--execute`,仍是 dry-run。
5 active youtube:comments:queue --or=1,2,3,4,5,6,13,14,81 --hours=72 --min=500
youtube.comments.queue
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_comments.php or=1,2,3,4,5,6,13,14,81 hours=72 min=500 23 4,10,16 * * *
04:23、10:23、16:23
Local DB
none by default; manual local-only `--execute` inserts `urt_comment_queue`
Legacy 會用 `urt_count.tags` 篩頻道,再找 `urt_video.publishedAt` 在指定 hours 內且 `viewCount/commentCount` 都超過 min 的影片,若不在 `urt_comment_queue` 就 insert queue row。Modern command 預設仍只列出 would-queue videos;manual local-only `--execute --limit` 會 idempotently 插入本機 `urt_comment_queue`。Scheduler 不傳 `--execute`,仍是 dry-run。