YouTube Board

擷取排程

Web request gates scheduler enabled local polling enabled

Web Request Gates

scheduler enabled local polling enabled scheduled write allowlist 28

Scheduler/polling 預設開啟;Dokploy 或 env 明確設為 false / off 時才會停用。

External Scheduler Activity

external scheduler active window 3 minutes

latest=2026-06-10 17:33:00 Asia/Taipei age=22.390709s evaluated=34 due=2 executed=2 skipped=0 failed=0

YouTube Data API Quota Estimate

estimated 542 / 10,000 units 9,458 remaining 5.4% 143 execute run records

Local estimator sums run-history job estimates for the current YouTube quota day (2026-06-10 00:00:00 PDT -> 2026-06-10 02:33:22 PDT). Google may report slightly different numbers because invalid/retried requests and hidden service-side accounting can differ.

top jobs: youtube.channels.videos.general=150; youtube.tvbs.live.poll=143; youtube.tag_videos.backfill=109; youtube.live.poll=60; youtube.tvbs.videos=30

Ingestion Health Check

status fail target date 2026-06-09 generated 2026-06-10 17:33:22 Asia/Taipei php artisan ingestion:health --date=2026-06-09
scheduler active YouTube 1,828 req / 180 fail / max 6,494ms AI 103 req / 51 fail / max 125,767ms AI daily 6/6 conditions mayor 3/3 people

job runtime、YouTube API latency、AI provider latency 會由 ingestion:run --execute --record 寫進 run-history;舊紀錄沒有 telemetry 時會顯示為 0 或 unknown。

  • 檢查最新 run-history 的 YouTube telemetry,確認是否為 quota/rate limit 或單一 method 失敗。
  • 檢查 AI provider telemetry;若 primary 慢或失敗但 fallback 成功,調整 provider 或降低單次 ai_call_limit。

recent runtimes: youtube.live.cleanup=138ms; youtube.live.poll=143ms; youtube.tvbs.live.poll=196ms; reports.live.build=1,892ms; reports.live.clean=-; reports.live.show=7ms; reports.live.static=17ms; youtube.channels.videos.general=1,597ms

34 jobs 外部資料擷取 13 內部報表處理 21 3 planned 31 active 0 blocked 34 command-ready 0 command-missing timezone Asia/Taipei dry-run php artisan ingestion:run

One-shot Runner

Execute mode 只會在這次 request 暫時啟用 runner。Scheduled writes 預設使用各 job 的 capped command;若 Dokploy/env 明確關閉 polling 或 scheduled writes,這次執行也會被 gate 擋下。

Latest One-shot Runs

Created Mode Job Evaluated Due Executed Skipped Failed YT Units File
2026-06-10 17:33:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-173300-d3060e73-6429-4eef-9d01-0b341caab7a0.json
2026-06-10 17:32:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-173200-eee5e243-9860-46ba-a330-51c0f77e9e4c.json
2026-06-10 17:31:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-173100-68ce630e-8d08-4dd5-9422-45578a13badb.json
2026-06-10 17:30:02 Asia/Taipei execute all due jobs 34 4 4 0 0 7 ingestion-runs/20260610-173002-90de91d8-6673-4b28-841b-71e6c64ef4f7.json
2026-06-10 17:29:00 Asia/Taipei execute all due jobs 34 3 3 0 0 1 ingestion-runs/20260610-172900-59c7c3d6-2382-4829-87ef-6546ccd7dae5.json
2026-06-10 17:28:01 Asia/Taipei execute all due jobs 34 4 4 0 0 3 ingestion-runs/20260610-172801-5cca22b8-c958-4f3d-b704-d39313075aea.json
2026-06-10 17:27:01 Asia/Taipei execute all due jobs 34 3 3 0 0 3 ingestion-runs/20260610-172701-68742259-1b9c-443b-8380-cdefaa4e917b.json
2026-06-10 17:26:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260610-172601-ac28f502-c7fa-462d-af8b-800ff2993426.json
2026-06-10 17:25:04 Asia/Taipei execute all due jobs 34 4 4 0 0 8 ingestion-runs/20260610-172504-00ca241e-363e-4647-b2b7-1e1f467b5f78.json
2026-06-10 17:24:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-172400-e34a6af6-c9f5-4451-a983-8b2c2a9815b6.json
2026-06-10 17:23:00 Asia/Taipei execute all due jobs 34 3 2 0 1 1 ingestion-runs/20260610-172300-18a2473d-0831-46ec-b2cd-d863face6ca3.json
2026-06-10 17:22:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-172200-74bbd2a4-927a-46f8-905d-1fa0923a1453.json
2026-06-10 17:21:01 Asia/Taipei execute all due jobs 34 4 4 0 0 2 ingestion-runs/20260610-172101-64172b22-1094-4649-9682-1c8c119abc0d.json
2026-06-10 17:20:02 Asia/Taipei execute all due jobs 34 4 4 0 0 7 ingestion-runs/20260610-172002-be898f9c-e6fe-433a-b40e-0daffe9081ed.json
2026-06-10 17:19:00 Asia/Taipei execute all due jobs 34 3 3 0 0 1 ingestion-runs/20260610-171900-f325f264-c27c-49ee-b263-34e9c8484649.json
2026-06-10 17:18:00 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260610-171800-0431d972-5425-4224-aab1-9566fea9fecc.json
2026-06-10 17:17:01 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-171701-4024c843-50e4-4db2-a22c-44f60d55abc6.json
2026-06-10 17:16:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260610-171601-feb73f5d-a44c-4271-9282-48e7344cd7a7.json
2026-06-10 17:15:03 Asia/Taipei execute all due jobs 34 4 4 0 0 8 ingestion-runs/20260610-171503-f17552fd-0d59-44ce-9afb-1bdf0dda427e.json
2026-06-10 17:14:01 Asia/Taipei execute all due jobs 34 4 4 0 0 3 ingestion-runs/20260610-171401-515aee30-216a-4d4f-b549-f40920cbfb83.json
2026-06-10 17:13:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260610-171301-d78174a3-844c-4a01-bfe0-c2be2343af9b.json
2026-06-10 17:12:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-171200-7e64c544-22bb-413c-897e-815bee685cb0.json
2026-06-10 17:11:35 Asia/Taipei execute all due jobs 34 5 5 0 0 7 ingestion-runs/20260610-171135-5a24927d-2557-40a6-a619-5bfc933bf715.json
2026-06-10 17:11:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-171100-107db190-f4a0-49af-9a26-0dbb43854664.json
2026-06-10 17:10:44 Asia/Taipei execute all due jobs 34 5 5 0 0 8 ingestion-runs/20260610-171044-32d3da73-ebb8-41b4-8ce2-99ec1d5124cd.json
2026-06-10 17:09:00 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260610-170900-02d1cb03-c6c7-494d-bc21-298c32c834e9.json
2026-06-10 17:08:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-170800-d6f78768-4e24-466a-a0bf-e06b2d5397f7.json
2026-06-10 17:07:01 Asia/Taipei execute all due jobs 34 4 4 0 0 2 ingestion-runs/20260610-170701-9365b356-4584-4d83-b385-37699773597a.json
2026-06-10 17:06:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260610-170600-c036c890-5a54-457f-9d5e-dc8d1c61461f.json
2026-06-10 17:05:02 Asia/Taipei execute all due jobs 34 5 5 0 0 7 ingestion-runs/20260610-170502-1150b8d6-e0bd-4612-9220-c6f768f6a936.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
preview mode; scheduled/local --execute marks stale urt_video_live.del_flag=1
Legacy 會把過久未更新、尚未結束且排程時間已過的 urt_video_live row 設為 del_flag=1;modern command 的 preview mode 會列出 would-mark rows。Explicit/scheduled --execute 會限量更新本機 del_flag;這個 cleanup job 使用本地資料。
1 active youtube:live:poll
youtube.live.poll
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_live.php * * * * *
每分鐘
Local DB
dashboard-safe live polling preview; scheduled/local --execute updates live rows and live logs
Legacy 從 urt_video_livemtime 超過 interval、尚未結束、排程時間已到且未刪除的直播 row;少於 10 筆且未指定 videoId 時會直接離開,否則呼叫 YouTube videos.list(liveStreamingDetails) 更新 urt_video_live 並 upsert urt_video_live_log.log_json。Modern command 的 preview mode 會列出 would-poll rows;explicit/scheduled --execute --videoId/--limit 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally 更新本機 urt_video_liveurt_video_live_log。Scheduler 在 scheduled-write gates 允許時使用 scheduled execute command;關閉時不執行 capped command。
1 active youtube:tvbs:live:poll
youtube.tvbs.live.poll
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_live_tvbs.php * * * * *
每分鐘 ingestion preview;legacy file 本身是 while(1) + sleep(30),未列在目前 cron snapshot
Local DB
preview mode; scheduled/local --execute updates urt_video_live_tvbs and urt_video_live_log_tvbs
Legacy TVBS poller 從 urt_video_live_tvbsmtime 超過硬編碼 40 秒、尚未結束、排程時間已到且未刪除的直播 row,呼叫 YouTube videos.list(liveStreamingDetails) 後更新 urt_video_live_tvbs 並 upsert urt_video_live_log_tvbs.log_json。這支是 standalone while-loop,未列在目前 production crontab;Modern command 的 preview mode 會列出 would-poll rows;manual/scheduled --execute --videoId/--limit 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally 更新本機 urt_video_live_tvbsurt_video_live_log_tvbs。Scheduler 在 scheduled-write gates 允許時使用 capped scheduled execute command;關閉時不執行 capped command。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
preview mode; scheduled/local --execute upserts urt_show_video_live display cache rows
Legacy make_live.php 會呼叫 YouTube API 補 urt_video / urt_video_liveshow_live.php 會寫 urt_show_video_live cache;modern command 的 preview mode 是 display-cache ingestion preview,用本機 urt_video_live + urt_video 預覽會補哪些 display cache rows。Explicit/scheduled --execute upsert 本機 display cache;YouTube discovery/polling 由 youtube:channels:videosyoutube:live:poll 負責。
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
preview mode; scheduled/local --execute deletes invalid urt_show_live_tag_date cache rows
Legacy 會刪除 urt_show_live_tag_datethe_date 太接近 cache ctime 的 row;modern command 的 preview mode 列出 would-delete rows。Explicit/scheduled --execute 會限量刪除本機 cache rows。
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
dashboard-safe (live dashboard snapshot)
Legacy 會寫 urt_show_video_live cache;modern command 輸出本機 live dashboard snapshot,可作為 scheduler one-shot 驗證目標;display cache refresh 由 reports:live:build --execute 負責。
1 active reports:live:static
reports.live.static
detail / next runs
ready /home/urtube/html/make_live.sh */19 * * * *
每 19 分鐘
Local DB
dashboard-safe (live static HTML ingestion preview)
Legacy 會執行 live.php or=1,2,12,13,14,81 > html/live_social.html;modern command 的 preview mode 會列出 would-generate target 並對應到 /live/current?or=1,2,12,13,14,81,靜態 HTML 輸出改由動態 Laravel route 承接。

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
preview mode; scheduled/local --execute inserts videos/schedules/live rows
Legacy 會挑 urt_channel.vtime 到期或 NULL 的頻道,先把 vtime 推到一小時後,再呼叫 YouTube playlistItems.list(snippet) 抓 uploads playlist,insert urt_videourt_video_schedule,live/upcoming 時 insert urt_video_live,最後依近七天影片數估算下一次 vtime。Modern command 的 preview mode 會列出 would-fetch channels 和本地估算;explicit/scheduled --execute --id/--channel --limit --max-results 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,idempotently upsert 本機 urt_videourt_video_scheduleurt_video_live 並更新 urt_channel.vtime。Scheduler 在 scheduled-write gates 允許時使用 scheduled execute command;單一 playlist API 失敗會跳過該 channel 並延後重試,避免整個 job 卡死。
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
preview mode; scheduled/local --execute inserts videos/schedules/live rows
Legacy 會從 urt_count.tags[52] 直播頻道,呼叫 YouTube playlistItems.list(snippet) 抓 uploads playlist,insert urt_videourt_video_schedule,並在 live/upcoming 時 insert urt_video_live。Modern command 的 preview mode 會列出 would-fetch channels;explicit/scheduled --execute --id/--channel --limit --max-results 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,idempotently upsert 本機 urt_videourt_video_scheduleurt_video_live 並更新 urt_channel.vtime。Scheduler 在 scheduled-write gates 允許時使用 scheduled execute command;關閉時不執行 capped command。
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
preview mode; scheduled/local --execute inserts videos/schedules/live rows
Legacy 會從 urt_count.tags[89] 群組頻道,呼叫 YouTube playlistItems.list(snippet) 抓 uploads playlist,insert urt_videourt_video_schedule,並在 live/upcoming 時 insert urt_video_live。Modern command 的 preview mode 會列出 would-fetch channels;explicit/scheduled --execute --id/--channel --limit --max-results 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,idempotently upsert 本機 urt_videourt_video_scheduleurt_video_live 並更新 urt_channel.vtime。Scheduler 在 scheduled-write gates 允許時使用 scheduled execute command;關閉時不執行 capped command。
2 active youtube:tag-videos:backfill
youtube.tag_videos.backfill
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video.php tagid=102 plus make_tag_date.php 17 0,3,6,9,12,15,18,21 * * *
每日 8 次;分頁抓 tag 頻道 uploads playlist 後重建逐日快取
YouTube Data API + Local DB
preview mode; scheduled/local --execute upserts urt_video, urt_video_schedule, urt_video_live, and urt_show_tag_date
針對每日新聞頻道等高產量 tag,不能只靠一般 discovery 每頻道少量 playlist item。此 job 依 urt_count.tags 找指定 tag 全部頻道,分頁抓 uploads playlist 直到超出日期範圍,寫入影片資料後用 TagDateCacheBuilder 重建 urt_show_tag_date,讓 /tags/{tagId}/days 使用本機每日快取。
2 active youtube:tvbs:videos
youtube.tvbs.videos
detail / next runs
ready /usr/bin/php /home/urtube/maint/get_video_tvbs.php */5 * * * *
每 5 分鐘 ingestion preview;legacy file 本身是 while loop + sleep(300),未列在目前 cron snapshot
Local DB
preview mode; scheduled/local --execute inserts videos/schedules/TVBS live rows
Legacy TVBS discovery 從 urt_count.tags[29] 頻道,逐一呼叫 YouTube playlistItems.list(snippet) 抓 uploads playlist,insert urt_videourt_video_schedule,並在縮圖含 default_live.jpg 或 live/upcoming 時 insert urt_video_live_tvbs。這支是 standalone while-loop,未列在目前 production crontab;Modern command 的 preview mode 會列出 would-fetch channels;manual/scheduled --execute --id/--channel --limit --max-results 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,idempotently upsert 本機 urt_video / urt_video_schedule / urt_video_live_tvbs。Scheduler 在 scheduled-write gates 允許時使用 capped scheduled execute command;關閉時不執行 capped command。

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
preview mode; scheduled/local --execute updates video stats/log rows
Legacy 從 urt_video_schedulestime 到期且 210 天內發布的影片,先把 stime 推到未來,再呼叫 YouTube videos.list(statistics) 並更新 urt_videourt_video_scheduleurt_video_logurt_video_log_history。Modern command 的 preview mode 會列出 would-refresh candidates;explicit/scheduled --execute --videoId/--limit 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally/idempotently upsert 本機 stats/log rows。Scheduler 在 scheduled-write gates 允許時使用 capped scheduled execute command;關閉時不執行 capped command。
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
preview mode; scheduled/local --execute updates duration queue rows
Legacy 從 urt_video_duration queue 挑 mtime/duration/stime 皆為 NULL 的 row,先把 stime 推到未來,再呼叫 YouTube videos.list(contentDetails) 並更新 duration/caption。Modern command 的 preview mode 會列出 queue candidates 和 missing queue diagnostics;explicit/scheduled --execute --videoId/--limit 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally/idempotently 更新本機 urt_video_duration--enqueue-missing 可從既有本機 urt_video 補缺少 duration row 的影片;未指定 --videoId 時會補一批最近影片,讓 scheduler 不會因空 queue 而空跑。Scheduler 在 scheduled-write gates 允許時使用 capped scheduled execute command;關閉時不執行 capped command。

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
preview mode; scheduled/local --execute updates channel/count/log rows
Legacy 從 urt_channelstime 過期或 NULL 的頻道,23 點只補 NULL,先更新 urt_channel.stime,再呼叫 YouTube channels.list(statistics) 並更新 urt_logurt_counturt_channel。Modern command 的 preview mode 會列出 would-refresh channels;explicit/scheduled --execute --u_id/--channel --limit 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally/idempotently 更新本機 urt_channelurt_counturt_log。Scheduler 在 scheduled-write gates 允許時使用 capped scheduled execute command;關閉時不執行 capped command。

Derived reports

Priority Status Modern command Command state Legacy command Schedule Dependency Writes Notes
3 active reports:channel-cloud:build
reports.channel_cloud.build
detail / next runs
ready /usr/bin/php /home/urtube/api/cloud.php uid=... 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
preview mode; scheduled/local --execute upserts urt_show_cloud cache rows
Modern command 的 preview mode 會列出會處理的 channel cloud period jobs。Explicit/scheduled --execute 會用本機 urt_video/tags 透過 ChannelCloudCacheBuilder 為指定或近期活躍頻道補 urt_show_cloud cache。
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
preview mode; scheduled/local --execute updates urt_count weekly/monthly delta columns
Legacy 會根據 urt_log.thedata update urt_count 的週/月 view/sub/video 增量與 mtime;modern command 的 preview mode 輸出本機 preview。Explicit/scheduled --execute 會限量更新本機 urt_count delta columns。
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 次
新文易數 tag.analysis.tw group API when scheduled-write gates allow it
preview mode; scheduled/local --execute upserts local tag_group rows
Legacy maintenance 會呼叫新文易數 https://tag.analysis.tw/api/group.php?hours=...,再 insert/update tag_group;modern command 的 preview mode 彙整本機 tag_group 狀態。Explicit/scheduled --execute 會呼叫 external group API 並 upsert 本機 tag_group
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 次
新文易數 tag.analysis.tw keyword API when scheduled-write gates allow it
preview mode; scheduled/local --execute upserts local tags rows
Legacy maintenance 會從新文易數 tag.analysis.tw 抓 tag JSON、更新 tags,再寫 data/keyword.json / data/keyword_all.json;modern command 的 preview mode 用本機 tags 預覽 keyword JSON。Explicit/scheduled --execute 會呼叫 tag.analysis.tw/api/tag_json.php 並 upsert 本機 tags;filesystem JSON 輸出改由 DB-backed cache 承接。
3 active reports:keywords:cache
reports.keywords.cache
detail / next runs
ready /usr/bin/php /home/urtube/maint/tags_all.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
preview mode; scheduled/local --execute upserts urt_show_data.tags_all keyword metric cache
Legacy 會從 urt_video 計算每個 keyword 的影片數、觀看數、成長等指標並寫入 urt_show_data.tags_all;modern command 的 preview mode 列出會處理的 keyword 數量。Explicit/scheduled --execute 會用本機資料透過 TagsAllCacheBuilder 補 keyword metric cache。
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
preview mode; scheduled/local --execute upserts people urt_show_tag_date cache rows
Legacy 從 tag_group政治人物,逐一呼叫 api/tag_period.php tag=... tagid=13 days=37 產生 cache;modern command 的 preview mode 列出會處理的 tag period jobs。Explicit/scheduled --execute 會用本機 urt_video/urt_count/tags 透過 TagDateCacheBuilder 為選定人物補 urt_show_tag_date cache,改走 Laravel cache builder。
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
preview mode; scheduled/local --execute updates urt_video_schedule.stime/mtime
Legacy 讀最近更新的 urt_video_schedule,用 urt_video_log_history 最近兩筆觀看數估算下一次 stime,再更新 urt_video_schedule.stime/mtime;modern command 的 preview mode 輸出估算結果。Explicit/scheduled --execute 會限量更新本機 schedule rows。
3 active reports:tag-cloud:build
reports.tag_cloud.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_tag_cloud.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
preview mode; scheduled/local --execute upserts urt_show_tag_cloud cache rows
Legacy 會從 urt_video 重新計算並補寫 urt_show_tag_cloud;modern command 的 preview mode 列出會處理的 tag cloud period jobs。Explicit/scheduled --execute 會用本機 urt_video/urt_count/tags 透過 TagCloudCacheBuilder 為選定標籤與天數組合補 urt_show_tag_cloud cache。
3 active reports:tag-date:build
reports.tag_date.build
detail / next runs
ready /usr/bin/php /home/urtube/maint/make_tag_date.php 27 3,8,11,13,18,23 * * *
每日 6 次
Local DB
preview mode; scheduled/local --execute upserts urt_show_tag_date cache rows
Legacy 會依 tagid/or/not 組合,從 urt_video/urt_count/tags 計算逐日 keyword 觀看數/影片數/重要度並寫入 urt_show_tag_date;modern command 的 preview mode 列出會處理的 tag/date 組合。Explicit/scheduled --execute 會用本機資料透過 TagDateCacheBuilderurt_show_tag_date cache。

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
preview mode; explicit --execute calls OpenCode-compatible chat completions and upserts urt_channel_ai / urt_ai_date
Legacy 先執行 make_channel_ai.php,對硬編碼 39 個頻道逐一用當日 urt_video raw rows 產生 prompt,影片數少於 10 就跳過,AI 回應後 insert urt_channel_ai;再用 get_ai_day.php condition=all/green/blue/neutral/finance/worldurt_channel_ai.result_json,依 urt_count.tags 套用 condition filters,合併媒體事件 prompt,呼叫 AI 後 insert urt_ai_date.channel_id/result_json。Modern command 的 preview mode 會預覽;explicit --execute 會用 OpenCode-compatible chat completions,idempotently upsert 本機 urt_channel_aiurt_ai_date。Scheduler scheduled write 會跑滿 39 個設定頻道、以 --channel-batch-size=12 分批刷新,並用 --ai-call-limit=45--channel-video-limit=120 控制 AI call/prompt 成本;local/production polling、allowlist gates 通過後才使用 capped execute command。
4 planned ai:days:refresh
ai.days_refresh
detail / next runs
ready operator-run make_ai_day.sh + ai_event_prompt.php + ai_cont_prompt.php sequence manual
手動維護;指定 --from/--to 後一次跑 daily/event/period/verify pipeline
Local DB
preview mode; explicit --execute orchestrates ai:daily, missing-only ai:event, ai:period, and final missing-row verification
用來取代人工逐步補 6/2、6/3 這類 AI daily/event/period chain 的操作。Dry-run 會列出每一天 daily aggregate、event missing rows 與相鄰 period matching 計畫;execute mode 先重生 daily aggregate,再以每個 event 的小批次 missing-only 補 urt_ai_event summary/people/media,接著寫入相鄰日 urt_ai_period,最後重新 preview 驗證 missing=0。預設 --daily-channel-limit=0,因此不會順手刷新 39 個 channel AI;若要完整日更需明確傳 --daily-channel-limit=39 --daily-channel-batch-size=12 並經 production allowlist 控制。
4 planned ai:event
ai.event
detail / next runs
ready /usr/bin/php /home/urtube/prompt/ai_event_prompt.php do=1 manual
手動維護;先產生 urt_ai_date daily topics 後再執行
Local DB
preview mode; explicit --execute calls OpenCode-compatible chat completions and upserts urt_ai_event summary/people/media rows
Legacy event workflow 會針對一個 daily topic 呼叫 summary、people、media prompt,把事件摘要、人物立場與媒體立場寫入 urt_ai_event。Modern ai:event 重用 AiDailyReport 目前可顯示的 topic resolver,因此支援 date-mode 一次補整天,也支援 --aipk --event 補舊 event URL;explicit --execute 會依 aipk/event/prompt_type idempotently upsert urt_ai_event,並用 --ai-call-limit 控制 production AI 寫入面。暫不排入 scheduler。
4 active ai:hourly
ai.hourly
detail / next runs
ready /usr/bin/php /home/urtube/prompt/ai_hour_prompt.php do=1 10 * * * *
每小時第 10 分
Local DB
preview mode; explicit --execute calls OpenCode-compatible chat completions and upserts urt_ai_hour
每小時第 10 分用 ai_hour_prompt.php do=1 對應流程抓上一個完整小時的 urt_video,套用 condition/tag filters,呼叫 AI 後 insert urt_ai_hourdata_type=each;modern command 的 preview mode 會預覽影片候選、prompt bounds、既有 hourly row,並支援 --at 針對指定時點補跑。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。
4 active ai:mayor-person
ai.mayor_person
detail / next runs
ready new Laravel mayor candidate daily AI dashboard 45 5,20 * * *
每日 05:45 產生早報,20:45 在資料更完整後覆寫同一日期報告;先由台北市候選人日報開始,可用 --city/--person 手動補跑
Local DB
preview mode; explicit/scheduled --execute calls OpenCode-compatible chat completions and upserts urt_mayor_person_ai
本 job 讀 mayor candidate 固定清單、urt_show_tag_dateurt_show_video_tag_dateurt_video,產生每位候選人的每日 Dashboard prompt;execute mode 用 OpenCode-compatible chat completions 產生「今日發生什麼、調整事項、今日行動」JSON,idempotently upsert urt_mayor_person_ai。頁面 request 只讀 cache,不直接呼叫 AI。Production scheduled execute 仍受 scheduler/local-production polling/allowlist gates 控制;手動補跑可用 ai:mayor-person --execute --city=taipei --person=蔣萬安,沈伯洋 --date=YYYY-MM-DD --ai-call-limit=2
4 planned ai:period
ai.period
detail / next runs
ready /usr/bin/php /home/urtube/prompt/ai_cont_prompt.php do=1 manual
手動維護;先產生相鄰兩天 urt_ai_date 後再執行
Local DB
preview mode; explicit --execute calls OpenCode-compatible chat completions and upserts urt_ai_period
Legacy continuous-period workflow 會比較相鄰兩天 AI daily 主題,把其實同一條事件線的不同標題寫入 urt_ai_period.result_json,並在 data_json 保存 from/to urt_ai_date.pk。Modern ai:period 先用 AiDailyReport 取得兩天可顯示 topics,因此能支援 daily result_json 空值時的 channel AI fallback;explicit --execute 只打一個 AI matching call 並 idempotently upsert urt_ai_period。目前不設 scheduled execute command,避免未審核前自動擴大 production AI 寫入面。

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 分 ingestion preview;目前 legacy cron snapshot 這行是註解狀態
Local DB
preview mode; scheduled/local --execute upserts mayor urt_show_tag_date cache rows
Legacy mayor/make_mayor.sh 會執行 mayor/city.php days=30 city=... 並覆寫 /home/urtube/mayor/html_*.html;modern command 的 preview mode 是 mayor static HTML ingestion preview,會列出 would-generate target 並對應到 /mayor/cities/{city}。Explicit/scheduled --execute 會用本機 urt_video/urt_count/tags 重建 mayor 需要的 urt_show_tag_date rows;靜態 HTML 輸出改由動態 Laravel route 承接。
4 active reports:static:build
reports.static.html
detail / next runs
ready /home/urtube/html/make_html.sh 13 8 * * *
每日 08:13
Local DB
dashboard-safe (group static HTML ingestion preview)
Legacy 會執行 group_chart.php / group_line.php 並覆寫 html/group_*.html;modern command 的 preview mode 會列出 would-generate target 並對應到 /groups/{group}/ranking/groups/{group}/trends,靜態 HTML 輸出改由動態 Laravel route 承接。

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 explicit/scheduled `--execute`
preview mode; scheduled/local --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。Production crontab 只在每小時第 5 分排程。Modern command 的 preview mode 會列出 would-drain rows 和三小時快取判斷;explicit/scheduled --execute --videoId/--limit --max-pages 會檢查 YOUTUBE_API_KEY 後限量呼叫 YouTube,transactionally 更新本機 comment/author/revision tables 並搬移 queue row。Scheduler 在 scheduled-write gates 允許時用 capped execute command 消化 queue。
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、10、16 點第 23 分
Local DB
preview mode; scheduled/local --execute inserts urt_comment_queue
Legacy 會用 urt_count.tags 篩頻道,再找 urt_video.publishedAt 在指定 hours 內且 viewCount/commentCount 都超過 min 的影片,若不在 urt_comment_queue 就 insert queue row。Production crontab 使用 hours=72 min=500 且只在 04/10/16 點第 23 分排程。Modern command 的 preview mode 會列出 would-queue videos;explicit/scheduled --execute --limit 會 idempotently 插入本機 urt_comment_queue。Scheduler 在 scheduled-write gates 允許時用 capped execute command 補 queue rows。