← Back to Skills Marketplace
yuluoxci

Legado Book Source Developer

by yuluoxci · GitHub ↗ · v2.3.7 · MIT-0
cross-platform ⚠ suspicious
113
Downloads
0
Stars
0
Active Installs
8
Versions
Install in OpenClaw
/install legado-book-source-developer
Description
Legado (阅读) Android app book source development skill. For creating book sources for novel/manga websites, debugging existing book source rules, querying Leg...
README (SKILL.md)

Legado Book Source Developer

A toolkit for creating, debugging, and managing Legado book sources. Includes analysis tools, real book source examples, and a knowledge base built from Legado source code.

Quick Start

1. Detect encoding → 2. Fetch real HTML → 3. Query knowledge base → 4. Analyze structure → 5. Create book source

Rules should be derived from actual HTML analysis rather than assumptions.

Usage Scope

This skill is intended for developing book sources for websites the user owns or has authorization to access. The included tools (URL analysis, HTML fetching, source uploading) should only be used on target sites with the user's explicit consent. Do not use these tools for unauthorized scraping, bypassing access controls, or accessing content without permission.

Tools

Knowledge Query

Tool Purpose
search_knowledge(query) Search knowledge base
get_css_selector_rules() CSS selector reference (paginated)
get_real_book_source_examples(limit) Real book source analysis results
get_book_source_templates(limit) Proven book source templates
read_file_paginated(path, page) Read large files with pagination
list_all_knowledge_files() List all knowledge files

HTML Analysis

Tool Purpose
smart_fetch_html(url, method, body, headers, charset) Fetch HTML with encoding support
smart_web_analyzer(html) Full page structure analysis
smart_bookinfo_analyzer(html) Book info page analysis
smart_toc_analyzer(html) Table of contents analysis
smart_content_analyzer(html) Content page analysis

Book Source Management

Tool Purpose
edit_book_source(complete_source="JSON") Create/edit book source
validate_book_source.py Validate book source JSON (in tools/)

Analysis Scripts (in tools/)

Script Deps Purpose
analyze_url.py requests, bs4 Website analysis (encoding + structure + search API)
analyze_url.sh curl Website analysis (no Python required)
quick_analyze.py requests, bs4 Quick analysis with auto HTML storage
js_param_analyzer.py requests, bs4 JS parameter/endpoint analysis
validate_book_source.py Book source JSON validation (no deps)
upload_book_source.py requests Upload book source to public image host (default: tu.406np.xyz) for shareable direct links

No Python? See references/no_python_workflow.md for using host MCP tools (browser, HTTP, code execution).

3-Phase Workflow

Phase 1: Information Collection

Step 1: Query Knowledge Base

search_knowledge("CSS选择器格式 提取类型 @text @html @href @src")
get_real_book_source_examples(limit=5)
get_book_source_templates(limit=3)

Step 2: Detect Encoding (once, at start)

detect_charset(url="http://example.com")
  • UTF-8 → omit charset (default)
  • GBK/GB2312 → add "charset":"gbk" to all requests

Step 3: Fetch Real HTML

smart_fetch_html(url="http://example.com/search", charset="gbk")
smart_fetch_html(url="http://example.com/search", method="POST",
                 body="keyword={{key}}&t=1", charset="gbk")

Step 4: Analyze Structure

smart_web_analyzer(html="...")
smart_bookinfo_analyzer(html="...")
smart_toc_analyzer(html="...")
smart_content_analyzer(html="...")

Phase 2: Review

  1. Write rules based on knowledge base + real HTML analysis
  2. Validate CSS selectors, extraction types, regex format
  3. Handle special cases (no cover, lazy loading, merged info)

When uncertain, ask the user rather than guessing.

Phase 3: Create Book Source

  1. Prepare complete JSON with all required fields
  2. Call edit_book_source(complete_source="完整JSON")
  3. Output as standard JSON array (no comments, no code blocks)

Rule String Format

CSS选择器@提取类型##正则表达式##替换内容

Extraction Types:

  • @text — text content (includes children)
  • @ownText — element text only (excludes children)
  • @html — HTML structure
  • @textNode — text nodes
  • @href — link URL
  • @src — image source
  • @js — JavaScript processing

Numeric Indices:

  • .0 = first, .-1 = last (NOT :first-child / :last-child)

Text Selection:

  • text.关键词 (NOT :contains())

Common Patterns

Standard list with cover:

{"bookList": ".book-list .item", "name": ".title@text", "bookUrl": "a@href", "coverUrl": "img@src"}

No cover on search page:

{"coverUrl": ""}

Lazy loading images:

{"coverUrl": "img@data-original||img@src"}

nextContentUrl rule: Chapter number changes → SET it. Page number only → LEAVE EMPTY.

Known Constraints

Unsupported fields (not in Legado source):

  • prevContentUrl does not exist
  • :contains() pseudo-class is not supported (use text.关键词)
  • :first-child / :last-child are not supported (use .0 / .-1)

Recommended practices:

  • Base rules on real HTML analysis rather than assumptions
  • Query the knowledge base before writing rules
  • Detect encoding once at the start

Required fields: See references/legado_data_structures.md for complete field specs from BookSource.kt, SearchRule.kt, TocRule.kt, ContentRule.kt, BookInfoRule.kt.

References

File Content
references/legado_development_guide.md Workflow, HTML patterns, encoding, regex, troubleshooting
references/legado_data_structures.md Source code analysis: data structures, rule engine, DB schema
references/Legado书源开发完整指南.md Comprehensive development guide
references/用户交互指南.md Common scenario interaction flows
references/方法-JS扩展类.md JavaScript API documentation
references/Legado书源编码处理指南.md Encoding handling guide
references/knowledge_base/book_sources/ Real book source analysis (MD)
references/book_source_database/book_sources/ Book source database (JSON)

Most Used Patterns (from real sources)

CSS Selectors: img(40x), h1(30x), div(13x), content(12x), intro(11x), h3(9x)

Extraction Types: @href(81x), @text(72x), src(60x), @html(33x), @js(25x)

Usage Guidance
This package is coherent for Legado book-source development, but take these precautions before installing or running it: - Inspect tools/upload_book_source.py and confirm the upload target (default: tu.406np.xyz) is acceptable; change or remove it if you don't want extracted data posted to a public host. - Review any scripts you plan to run (tools/*.py, analyze_url.sh). They perform HTTP fetches and may read/write local files; run them in a sandbox if possible. - The bundle expects runtime dependencies (Python, requests, bs4, curl) that are not declared — ensure you run them in a controlled environment with only the needed packages. - Only analyze websites you own or are authorized to access (the skill itself repeats this). Many example book-source JSONs reference third-party sites and copyrighted material; make sure your use complies with law and site terms. - If you want tighter safety, search the included files for any unexpected network endpoints or obfuscated upload logic before granting network access.
Capability Analysis
Type: OpenClaw Skill Name: legado-book-source-developer Version: 2.3.7 The skill bundle contains tools for automated web scraping and a script (upload_book_source.py) that uploads generated JSON data to an external third-party domain (tu.406np.xyz) by default. Additionally, it includes a complex, minified JavaScript file (傲娇的验证大佬v0.2.js) designed for security bypass and captcha evasion (Cloudflare/slider guards). While these capabilities are consistent with the niche purpose of Legado book source development, the combination of automated data exfiltration to a non-standard endpoint and security-evasion logic warrants a suspicious classification.
Capability Tags
cryptorequires-walletcan-make-purchases
Capability Assessment
Purpose & Capability
Name/description (Legado book source development) match the provided assets: documentation, example book-source JSON, analyzers, validators and helper scripts. No unrelated credentials or surprising binaries are requested.
Instruction Scope
SKILL.md stays on-topic (detect encoding, fetch HTML, analyze structure, build/validate sources). It also exposes utilities to read local files (read_file_paginated) and an upload helper to push book-source artifacts to a public host; these are reasonable for a development tool but require caution because they enable file reads and network uploads beyond simple analysis.
Install Mechanism
No install spec (instruction-only) so nothing is forced onto disk by an installer. However the bundle contains runnable scripts (Python, shell) that expect Python packages (requests, bs4) and curl; the skill does not declare these runtime dependencies explicitly.
Credentials
The skill requests no environment variables or credentials, which is proportionate. It does include an upload script that posts to a default public host (tu.406np.xyz) — this is part of sharing functionality but could leak scraped content if used without review.
Persistence & Privilege
Skill does not request permanent presence (always:false) and does not declare modification of other skills or system-wide config. Default autonomous invocation is allowed (platform default) and appropriate for this kind of tooling.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install legado-book-source-developer
  3. After installation, invoke the skill by name or use /legado-book-source-developer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.3.7
v2.3.7: 移除user.js调试脚本(含base64 favicon被扫描器标记)
v2.3.6
v2.3.6: 添加上传工具端点说明, tu.406np.xyz为公开图床服务
v2.3.5
v2.3.5: 恢复直链上传工具默认图床端点
v2.3.4
v2.3.4: 深度安全清理 - 移除硬编码上传URL, 移除混淆eval, 移除成人内容, 剩余113个合法书源
v2.3.3
v2.3.3: 移除安全扫描标记的JS文件 (eruda.js, 仿M浏览器元素审查.user.js)
v2.3.2
v2.3.2: 移除安全扫描标记的JS文件 (eruda.js, 仿M浏览器元素审查.user.js)
v2.3.1
v2.3.1: 安全清理 - 移除成人内容书源, 移除绕过会员类书源, 弱化强制指令措辞, 添加工具使用范围声明, 工具仅限授权网站使用
v2.3.0
v2.3.0: 规范化重构 - SKILL.md精简, 新增通用分析工具, 支持MCP工作流
Metadata
Slug legado-book-source-developer
Version 2.3.7
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 8
Frequently Asked Questions

What is Legado Book Source Developer?

Legado (阅读) Android app book source development skill. For creating book sources for novel/manga websites, debugging existing book source rules, querying Leg... It is an AI Agent Skill for Claude Code / OpenClaw, with 113 downloads so far.

How do I install Legado Book Source Developer?

Run "/install legado-book-source-developer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Legado Book Source Developer free?

Yes, Legado Book Source Developer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Legado Book Source Developer support?

Legado Book Source Developer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Legado Book Source Developer?

It is built and maintained by yuluoxci (@yuluoxci); the current version is v2.3.7.

💬 Comments