2.7 KiB
2.7 KiB
News Live Streams Collector Format
news_live_streams 采集器面向“频道目录 JSON”输入,而不是直接抓网页。
这样做的目标是:
- 让后台能够稳定接入世界各地新闻直播源
- 让
Earth页面电视模块始终消费统一结构 - 便于后续接入类似
worldmonitor那种 YouTube / HLS / iframe 混合频道目录
推荐 JSON 结构
{
"sources": [
{
"id": "bbc-world-news",
"name": "BBC World News",
"provider": "BBC",
"region": "UK",
"language": "en",
"source_type": "youtube",
"youtube_video_id": "dQw4w9WgXcQ",
"youtube_channel": "https://www.youtube.com/@BBCNews",
"embed_url": "",
"stream_url": "",
"homepage_url": "https://www.youtube.com/@BBCNews/live",
"poster_url": "",
"sort_order": 220,
"is_enabled": true,
"notes": "Primary English global news channel"
},
{
"id": "france24-en",
"name": "France 24 English",
"provider": "France 24",
"region": "France",
"language": "en",
"source_type": "hls",
"stream_url": "https://example.com/live.m3u8",
"homepage_url": "https://www.france24.com/en/live",
"sort_order": 230,
"is_enabled": true
},
{
"id": "cctv4-page",
"name": "CCTV-4 中文国际",
"provider": "CCTV",
"region": "China",
"language": "zh-CN",
"source_type": "iframe",
"embed_url": "https://tv.cctv.com/live/cctv4/",
"homepage_url": "https://tv.cctv.com/live/cctv4/",
"sort_order": 10,
"is_enabled": true
}
]
}
字段约定
id: 唯一标识,建议稳定不变name: 频道显示名provider: 提供方region: 国家或地区language: 语言代码source_type:iframe/hls/video/external/youtubeembed_url: 适合 iframe 内嵌的页面stream_url: 直接视频流地址homepage_url: 官网或频道页youtube_video_id: YouTube 直播视频 IDyoutube_channel: YouTube 频道 handle 或频道 URLposter_url: 封面图,可选sort_order: 排序值,越小越靠前is_enabled: 是否启用notes: 简短备注
面板行为约定
youtube- 优先使用
youtube_video_id - 无法内嵌时至少保留
youtube_channel或homepage_url供外部打开
- 优先使用
hls/video- 优先走
stream_url
- 优先走
iframe- 优先走
embed_url
- 优先走
external- 不尝试内嵌,只保留外部打开
当前实现状态
- 后台设置页可以手工维护频道目录
Earth电视模块会合并:- 手工配置源
news_live_streams采集器采集源
- 当前默认兜底源为
CCTV-4 中文国际