# 网易新闻 — 多频道共享同一套选择器
# 走 legacy CSS scrape 路径（cms_adapter 留空，pipeline 通过 yaml_path 读这里）
#
# DOM 结构（2026-04-27 实测）：
#   列表: <div class="idx_cm_list"><ul><li><a href title>标题</a></li> × 12 </ul></div>
#         首页是 SPA，更多内容靠 JS 翻页拉 JSON，httpx 无法分页 → pagination=none
#   详情: <h1.post_title>标题</h1>
#         <div.post_info>2026-04-27 07:11:06　来源: <a>环球网</a></div>
#         <div.post_body>正文…</div>
#
# 添加新频道（如 tech / sports …）只需要：
#   - column_id: <slug>
#     name: <中文名>
#     list_url: https://news.163.com/<slug>/
#     alias_of: domestic        # ← 选择器、分页、详情自动从 domestic 继承
#     schedule: "*/30 * * * *"
#     enabled: true
#
# 如果某频道有特殊 DOM，本字段 (list_selector / pagination / detail)
# 在该 column 块里直接显式给值即可，会覆盖继承来的内容。

site_id: wy_news
site_name: 网易新闻
base_url: https://news.163.com
default_strategy: httpx
concurrency: 1
interval_sec: 10
enabled: true
respect_robots: true

# 任何未在 columns: 中显式列出的 column_id 都自动用这套（admin UI 通过
# discover-html + bulk-create 加新频道时不必改本 yaml）
default_column:
  list_selector:
    row: ".idx_cm_list li"
    href: "a::attr(href)"
    title: "a::text"
  pagination:
    type: none
  detail:
    title: "h1.post_title::text, h1::text"
    publish_time: "div.post_info::text"
    source: "div.post_info a::text"
    content: "div.post_body, div#endText"
    attachment_css: ""

columns:
  # ── 主模板：domestic 持有完整选择器，其它频道用 alias_of 继承 ──
  - column_id: domestic
    name: 国内新闻
    category: 资讯
    list_url: https://news.163.com/domestic/

    list_selector:
      row: ".idx_cm_list li"
      href: "a::attr(href)"
      title: "a::text"
      # 列表里没单独的日期 — pipeline 会从详情页 publish_time 抽

    pagination:
      type: none

    detail:
      title: "h1.post_title::text, h1::text"
      publish_time: "div.post_info::text"
      source: "div.post_info a::text"
      content: "div.post_body, div#endText"
      attachment_css: ""

    schedule: "*/30 * * * *"
    enabled: true

  - column_id: world
    name: 国际新闻
    category: 资讯
    list_url: https://news.163.com/world/
    alias_of: domestic
    schedule: "*/30 * * * *"
    enabled: true
