{"repo":"solarhell/font_obfuscator","free":true,"listed":false,"github":"https://github.com/solarhell/font_obfuscator","clone":"git clone https://github.com/solarhell/font_obfuscator.git","description":"字体混淆服务","language":"Rust","stars":173,"topics":["crawler"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"font obfuscator 中文 English --- 中文 简介 字体混淆反爬虫工具。通过重映射字体中的字形（glyph），使 HTML 中的文本与用户看到的内容不同，从而防止爬虫直接抓取页面文字。 支持混淆英文、数字及大部分 CJK（中日韩）字符，生成 TTF 和 WOFF2 格式的字体文件。 使用 Rust 实现，基于 Google fontations 项目进行字体解析和构建。 原理 普通混淆 ：用户提供明文和阴书（长度相同），生成一个自定义字体，其中阴书字符的 Unicode 码位指向明文字符的字形。HTML 中写阴书文本，浏览器加载自定义字体后渲染出明文内容，爬虫只能读到阴书。 加强混淆 ：只需提供明文，自动使用 Unicode Private Use Area（U+E000-U+F8FF）的随机码位进行映射，并返回对应的 HTML entity 编码。爬虫无法通过 Unicode 表反查字符含义。 快速开始 环境变量 变量 默认值 说明 ------ -------- ------ PORT 1323 服务监听端口 LISTEN ADDR 127.0.0.1 服务监听地址 BASE FONT PATH base-font/KaiGenGothicCN-Regular.ttf 基础字体文件路径 API GET / 健康检查，返回 it works 。 POST /api/encrypt 普通混淆（明文 + 阴书）。生成的字体只包含映射的字符。 设置 keep all: true 可保留原字体中的所有字符，仅替换指定字符的字形（#97）。 响应： POST /api/encrypt-plus 加强混淆（仅需明文）。 响应： 前端使用示例 --- English Introduction A font obfuscation tool for anti-scraping. It remaps glyphs in a font so that the text in HTML differs from what users actually see, preventing crawlers from directly extracting page content. Supports obfuscation of English, digits, and most CJK characters. Generates TTF and WOFF2 font files. Built with Rust, using Google's fontations project for font parsing and building. How It Works Basic obfuscation : Provide plaintext and shadow text (same length). A custom font is generated where shadow characters' Unicode codepoints map to plaintext characters' glyphs. The HTML contains shadow text, but the browser renders plaintext when the custom font is loaded. Crawlers can only read the shadow text. Enhanced obfuscation : Only plain","default_branch":null,"files":null,"tree":[],"storefront":"/r/solarhell","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/solarhell/font_obfuscator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}