veneracat-core

module
v0.0.0-...-8a5ce65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: GPL-3.0, LGPL-3.0

README

VeneraCat Core

English | 简体中文

VeneraCat Core

Nekularity(iOS/iPadOS)与 Nekophage(桌面)共用的核心库,使用 Go 编写,许可证为 LGPL-3.0-or-later(附 App Store / DRM 例外)。

功能

  • 漫画源:兼容官方 Venera 的 ComicSource JavaScript 脚本与订阅索引 index.json,在 MoeJS 上运行,每个源一个独立引擎。
  • 视频源:JavaScript VideoSource 插件、Kazumi 规则、内置源,订阅格式为 vcvideo.json。
  • 备份:读取官方 .venera 备份,按项预览和恢复。
  • 人机验证:识别 Cloudflare 挑战,由客户端在 WebView 中完成后自动重试。
  • HLS:播放列表解析、改写、去广告、AES-128 解密。

Core 不发起网络连接,也不打开 WebView 或播放器;这些由客户端通过 host 包中的接口提供。

目录

目录 内容
host/ 客户端需要实现的接口
comic/ 漫画源运行时与宿主接口
video/ 视频数据模型、Kazumi、内置源、HLS
plugin/ 统一的插件注册表
subscription/ 漫画与视频订阅索引
backup/ 官方 .venera 备份
mobile/ 供 Swift 调用的 gomobile 接口
version/ 回答「这是哪一版 Core」,见下文
apple/ Apple 平台冒烟测试
docs/ 规格与设计文档
scripts/ 构建与验证脚本

开发

gofmt -l .        # 应无输出
go vet ./...
go test -race ./...

Apple 平台的构建与验证见 scripts/mac-verify.sh,需要 macOS 与 Xcode。

这是哪一版 Core

version.String() 给出可打印的版本:Core 自己是主程序时用它自己的提交(工作树有改动会带 -dirty);被别的程序链接时,debug.ReadBuildInfo() 里那个提交属于那个程序,不能拿来冒充 Core —— 所以由链接方写一份戳记:

import coreversion "github.com/laincat/veneracat-core/version"

func init() { coreversion.SetRelease("35b3ed9e…") }

桌面端就是这么做的:scripts/fetch-core.sh 每次生成一个 corestamp.go 写入同步到的提交号,Nekophage -version 因此能同时给出自身提交与 Core 提交。

文档索引见 docs/README.md。

Directories

Path Synopsis
Package aiapi builds the requests for the standard AI protocols that VeneraCat Core supports out of the box.
Package aiapi builds the requests for the standard AI protocols that VeneraCat Core supports out of the box.
Package attribution describes who made a source or plugin and where it lives.
Package attribution describes who made a source or plugin and where it lives.
Package backup reads official Venera ".venera" backups and turns them into structured data a client can restore.
Package backup reads official Venera ".venera" backups and turns them into structured data a client can restore.
Package challenge detects anti-bot challenges and runs the verify-and-retry flow shared by comic sources and video rules.
Package challenge detects anti-bot challenges and runs the verify-and-retry flow shared by comic sources and video rules.
comic
hostapi
Package hostapi implements the Core side of the legacy ComicSource sendMessage methods that need the client: "http" and "cookie".
Package hostapi implements the Core side of the legacy ComicSource sendMessage methods that need the client: "http" and "cookie".
hostapi/convert
Package convert implements the "convert" sendMessage method of the legacy ComicSource API (docs/SENDMESSAGE-SPEC.md section 1.5) as a pure function.
Package convert implements the "convert" sendMessage method of the legacy ComicSource API (docs/SENDMESSAGE-SPEC.md section 1.5) as a pure function.
html
Package html implements the DOM-handle protocol of the legacy ComicSource "html" sendMessage method (docs/SENDMESSAGE-SPEC.md, section 4) without any JavaScript engine dependency.
Package html implements the DOM-handle protocol of the legacy ComicSource "html" sendMessage method (docs/SENDMESSAGE-SPEC.md, section 4) without any JavaScript engine dependency.
image
Package image implements the in-memory pixel-buffer protocol used by comic modifyImage scripts (docs/SENDMESSAGE-SPEC.md, section 5).
Package image implements the in-memory pixel-buffer protocol used by comic modifyImage scripts (docs/SENDMESSAGE-SPEC.md, section 5).
js
Package js runs legacy ComicSource and VeneraCat VideoSource scripts on MoeJS.
Package js runs legacy ComicSource and VeneraCat VideoSource scripts on MoeJS.
version
Package version compares comic-source versions the way Venera does.
Package version compares comic-source versions the way Venera does.
Package host defines what VeneraCat Core asks of its client.
Package host defines what VeneraCat Core asks of its client.
sse
Package sse decodes server-sent events from a client-owned stream.
Package sse decodes server-sent events from a client-owned stream.
Package magpieplugin handles Magpie provider plugin packages independently of comic sources.
Package magpieplugin handles Magpie provider plugin packages independently of comic sources.
Package magpierouting chooses which provider account and model answers a request.
Package magpierouting chooses which provider account and model answers a request.
Magpie provider packages, reached through the same JSON-in/JSON-out surface as the rest of Core.
Magpie provider packages, reached through the same JSON-in/JSON-out surface as the rest of Core.
Package plugin is the single entry point clients use to manage sources: comic sources, JavaScript video plugins, Kazumi rules and built-in video providers share one key namespace and one install/enable/remove flow.
Package plugin is the single entry point clients use to manage sources: comic sources, JavaScript video plugins, Kazumi rules and built-in video providers share one key namespace and one install/enable/remove flow.
Package service validates the shared service plugins of the unified source collection: the Trakt, TMDB and Bangumi kinds, plus anything later.
Package service validates the shared service plugins of the unified source collection: the Trakt, TMDB and Bangumi kinds, plus anything later.
Package subscription reads comic-source subscription indexes ("index.json") in the format used by official Venera and community lists such as venera-app/venera-configs and laincat/vensrc: a JSON array of entries
Package subscription reads comic-source subscription indexes ("index.json") in the format used by official Venera and community lists such as venera-app/venera-configs and laincat/vensrc: a JSON array of entries
Package version answers "which Core is this" for anything that links Core directly: the desktop binary, tests, and a bug report.
Package version answers "which Core is this" for anything that links Core directly: the desktop binary, tests, and a bug report.
Package video defines the data model shared by every video provider: JavaScript VideoSource plugins, imported Kazumi rules and the built-in providers rewritten from other apps.
Package video defines the data model shared by every video provider: JavaScript VideoSource plugins, imported Kazumi rules and the built-in providers rewritten from other apps.
builtin/hongguo
Package hongguo is the built-in provider for 红果短剧 (https://hongguoduanju.com), written against the public web pages only.
Package hongguo is the built-in provider for 红果短剧 (https://hongguoduanju.com), written against the public web pages only.
hls
Package hls is a pure, network-free toolkit for HLS (RFC 8216) playlists.
Package hls is a pure, network-free toolkit for HLS (RFC 8216) playlists.
kazumi
Package kazumi runs Kazumi video rules (github.com/Predidit/KazumiRules, MIT licensed) as VeneraCat video providers.
Package kazumi runs Kazumi video rules (github.com/Predidit/KazumiRules, MIT licensed) as VeneraCat video providers.
Package webcookie reads the cookies the system web view keeps.
Package webcookie reads the cookies the system web view keeps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL