refactor: restructure plugins per MTSS standard, consolidate assets to res/

Per docs/plugin-audit-report.md (plugins normalized to
Trigger(handlers) → Service(services) → Model(repository/models) + utils):

- Split monolithic __init__.py into handlers/services/utils across
  dailywife, deer_pipe, dice, galgame_card, helldivers_tools,
  huoziyinshua, learning_chat, makeaquote, mc_server_status,
  ncm_saying, picfinder_take, picstatus, random_jm_code, regif,
  steam_info, video_analysis, group_tools
- Move static assets under res/: deer_pipe font/img, makeaquote font,
  helldivers img/templates, huoziyinshua HuoZiYinShua
- Add config.py + register_config_items to ncm_saying, random_jm_code,
  group_tools; learning_chat unified config bridge
- Remove deprecated: voice_trans plugin, bf_bot/test.py, dead code in
  dailywife/deer_pipe, empty dirs, debug scripts under helldivers temp
- Disable brash_general_supercredits_tools (stub comment only)
- bot.py: optional stdout/stderr redirect to log file for Web log viewer,
  force ANSI colorize on non-TTY sinks
- Move runtime data (jm_code.json) out of plugin dir into hexi/data
- Docs: plugin-audit-report.md; README reflects removed plugins

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-09-03 00:44:38 +08:00
co-authored by Claude
parent 25bc30611f
commit 9371a28e35
2389 changed files with 5100 additions and 10127 deletions
@@ -1,6 +1,5 @@
"""抖音视频/图文解析编排层"""
import os
import re
import urllib.parse
from pathlib import Path
@@ -9,19 +8,15 @@ from typing import Optional, Union
import httpx
from nonebot import logger
from ..fetchers.douyin_api import fetch_douyin_content
from ..fetchers.douyin_ssr import MOBILE_UA, fetch_douyin_note_ssr
from ..services.fetchers.douyin_api import fetch_douyin_content
from ..services.fetchers.douyin_ssr import MOBILE_UA, fetch_douyin_note_ssr
from ..models import DouyinFetchError
from ..utils import parse_netscape_cookies
from ..utils import get_data_dir, parse_netscape_cookies
from .sender import PendingMedia, _as_paths
SHORT_LINK_PATTERN = re.compile(r"(v\.douyin\.com/[A-Za-z0-9_\-]+)")
def _get_data_dir() -> str:
return os.path.join(os.path.dirname(__file__), "..", "data")
async def _resolve_short_link(url: str) -> Optional[str]:
"""短链重定向:httpx 取 Location(最多 3 跳),失败返回 None"""
try:
@@ -83,7 +78,7 @@ async def parse_douyin(
try:
is_img_post = False
cookies_path = os.path.join(_get_data_dir(), "cookies.txt")
cookies_path = get_data_dir() / "cookies.txt"
cookies = parse_netscape_cookies(cookies_path)
# 先试 SSR(秒级、免浏览器),失败一律回退 playwright 链路。
# 2026-08-13 起抖音对 iesdouyin SSR 端点整体降级(登录态也拿不到
@@ -3,7 +3,6 @@
from __future__ import annotations
import html
import os
import re
from typing import Optional
@@ -13,16 +12,13 @@ from nonebot.rule import to_me
from nonebot_plugin_alconna import UniMessage
from nonebot_plugin_alconna.uniseg import get_target
from ..fetchers.bilibili_content import fetch_bilibili_content, resolve_short_link
from ..fetchers.rednote_content import fetch_rednote_content
from ..services.fetchers.bilibili_content import fetch_bilibili_content, resolve_short_link
from ..services.fetchers.rednote_content import fetch_rednote_content
from .douyin import parse_douyin, process_douyin_res
from .sender import PendingMedia, send_pending_media
from .universal import handle_universal
from ..list_proc import AUTO_LINK_KEYWORDS, get_group_auto_link, verify_user
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
FILE_PATH = os.path.join(BASE_DIR, "data", "list.json")
URL_PATTERN = re.compile(r"(https?://\S+)")
XCX_PATTERN = r"QQ小程序(?:&amp;#93;|&#93;|\])"
@@ -15,7 +15,7 @@ from typing import Optional, Union
from nonebot import logger
from nonebot_plugin_alconna import UniMessage
from ..storage.s3 import upload_with_plan
from ..services.storage.s3 import upload_with_plan
@dataclass
@@ -6,7 +6,7 @@ from typing import Optional
from nonebot import logger
from nonebot_plugin_alconna import UniMessage
from ..fetchers.video_downloader import download_video
from ..services.fetchers.video_downloader import download_video
from .sender import PendingMedia, _as_paths