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-13 21:03:01 Asia/Taipei age=31.445733s evaluated=34 due=2 executed=2 skipped=0 failed=0

YouTube Data API Quota Estimate

estimated 1,161 / 10,000 units 8,839 remaining 11.6% 335 execute run records

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

top jobs: youtube.channels.videos.general=350; youtube.tvbs.live.poll=335; youtube.tag_videos.backfill=206; youtube.live.poll=124; youtube.tvbs.videos=70

Ingestion Health Check

status fail target date 2026-06-12 generated 2026-06-13 21:03:33 Asia/Taipei php artisan ingestion:health --date=2026-06-12
scheduler active YouTube 1,745 req / 178 fail / max 7,143ms AI 105 req / 50 fail / max 125,633ms 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=139ms; youtube.live.poll=520ms; youtube.tvbs.live.poll=184ms; reports.live.build=1,807ms; reports.live.clean=-; reports.live.show=7ms; reports.live.static=16ms; youtube.channels.videos.general=2,301ms

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-13 21:03:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-210301-b63f6eda-3777-45e1-b505-0203b159e719.json
2026-06-13 21:02:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-210201-ed46d007-d65a-4739-b0d8-851e0724c91d.json
2026-06-13 21:01:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-210101-744b91c3-9f4d-42c8-87e2-1515eb25b19b.json
2026-06-13 21:00:05 Asia/Taipei execute all due jobs 34 8 7 0 1 8 ingestion-runs/20260613-210005-7a144da5-d1df-4a6d-ad25-5c46239ebad3.json
2026-06-13 20:59:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-205900-dc679a8c-541e-47ba-9182-afed877edfd8.json
2026-06-13 20:58:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-205800-fb62fc0d-539a-414c-9d4e-443f4954a020.json
2026-06-13 20:57:00 Asia/Taipei execute all due jobs 34 3 3 0 0 1 ingestion-runs/20260613-205700-4f62b609-1a8c-426f-8717-d66e8d13bffe.json
2026-06-13 20:56:00 Asia/Taipei execute all due jobs 34 3 3 0 0 1 ingestion-runs/20260613-205600-42aa4edb-95ec-4eb7-91d1-e3119ff10303.json
2026-06-13 20:55:05 Asia/Taipei execute all due jobs 34 4 4 0 0 7 ingestion-runs/20260613-205505-6aabe0d1-8cb9-4d28-bbf8-1f3fa3603b2e.json
2026-06-13 20:54:00 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260613-205400-dfd39b1d-330b-4564-aa75-934876979521.json
2026-06-13 20:53:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-205301-607ec6f2-6310-4702-a1fd-e52086eb0967.json
2026-06-13 20:52:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-205201-75fcb363-e496-4ed8-bdc5-fd99f98932ba.json
2026-06-13 20:51:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-205101-7bebd620-2456-481f-bfd7-107ff8107b74.json
2026-06-13 20:50:06 Asia/Taipei execute all due jobs 34 4 4 0 0 8 ingestion-runs/20260613-205006-dd44bd9d-3b24-4a80-ae7d-9ad351ee72c3.json
2026-06-13 20:49:01 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260613-204901-d84ff727-b3f1-4ee1-a699-9c5700c707c4.json
2026-06-13 20:48:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-204800-dd069af9-3524-4282-966c-54aecd2baa35.json
2026-06-13 20:47:09 Asia/Taipei execute all due jobs 34 6 6 0 0 8 ingestion-runs/20260613-204709-23ffb97a-cee9-445c-a85d-f82b7ff08b3f.json
2026-06-13 20:44:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-204400-351ede61-435f-43b9-bd1e-ba7cb63ddd66.json
2026-06-13 20:43:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-204300-68569ead-3891-4cd9-b261-c2085c397878.json
2026-06-13 20:42:00 Asia/Taipei execute all due jobs 34 3 3 0 0 1 ingestion-runs/20260613-204200-c94b77dd-c5d8-48da-bd44-13b31bdb05ce.json
2026-06-13 20:41:00 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-204100-117f3191-1db0-4fff-9e77-66d26b2bc943.json
2026-06-13 20:40:03 Asia/Taipei execute all due jobs 34 4 4 0 0 8 ingestion-runs/20260613-204003-f7ca07fc-22cf-452c-905d-3728713f03be.json
2026-06-13 20:39:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-203901-9b4c54c7-314a-4e2d-994e-f089d8306105.json
2026-06-13 20:38:01 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260613-203801-e218ee39-c768-4cbe-b475-3fc6939b64fb.json
2026-06-13 20:37:01 Asia/Taipei execute all due jobs 34 2 2 0 0 2 ingestion-runs/20260613-203701-a71bee62-1bb9-4531-95c0-822506c91831.json
2026-06-13 20:36:00 Asia/Taipei execute all due jobs 34 3 3 0 0 2 ingestion-runs/20260613-203600-22245142-b6b7-4373-9c63-0b5c982ff25c.json
2026-06-13 20:35:10 Asia/Taipei execute all due jobs 34 5 5 0 0 7 ingestion-runs/20260613-203510-52cd2173-3215-42c8-aa08-eb2225788319.json
2026-06-13 20:34:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-203400-1af185a9-03fc-4cb1-ba26-884fc51d2f0d.json
2026-06-13 20:33:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-203300-68571b28-05e0-4e34-a2b8-fd514247d2b5.json
2026-06-13 20:32:00 Asia/Taipei execute all due jobs 34 2 2 0 0 1 ingestion-runs/20260613-203200-ed476502-a218-4e4f-967f-5626314f3bf7.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。