HGhub README

The project's README from github.com/Minireel/HGhub. As one markdown file: README.md.

HGhub

黄果短剧第三方客户端 · Rust + Tauri 2

Windows / Android 双端 · Fluent 设计 · 沉浸式竖屏播放 alt text

⚠️ 本项目仅供 学习与技术交流,不提供、不存储、不分发任何音视频内容。 所有内容均来自第三方站点,请自行判断合规性,并在 24 小时内删除相关资源。

技术栈

层 选型
壳 Tauri 2(Rust 1.9x)
前端 React 19 + TypeScript + Vite 7 + Tailwind CSS 4
播放 hls.js(HLS / AES-128)
网络 reqwest + rustls
图标 内联 SVG

目录

.
├─ src/                      前端
│  ├─ api.ts                 接口封装 + 本地媒体协议 URL
│  ├─ store.tsx              全局状态(导航栈 / 用户 / 本地收藏 / 主题)
│  ├─ html.ts                吃瓜正文清洗与图片代理
│  ├─ components/            Feed(播放页)/ VideoSurface / PlayerControls / Panels / UI
│  └─ pages/                 Home / Search / Category / Profile / Posts
├─ src-tauri/                Rust 后端
│  └─ src/
│     ├─ net.rs              请求层(边缘信封 + 重试)
│     ├─ api.rs              业务命令
│     ├─ media.rs            封面解密 + HLS 代理 + 缓存
│     └─ session.rs          token 持久化
└─ docs/API.md               接口文档

开发 / 构建

pnpm install          # 首次安装
pnpm app:dev          # 桌面端热重载
pnpm app:build        # 打包 Windows 安装程序(NSIS)

Android(需 Android SDK + NDK,并配置 ANDROID_HOME / NDK_HOME):

pnpm android:init     # 首次生成 android 工程
pnpm android:dev      # 真机 / 模拟器调试
pnpm android:build    # 产出 APK

环境注意

实现要点

  1. 统一边缘信封:站点把 /api/** 收敛为 POST /api/edge/request(method/path/body(base64)/content_type + Authorization: Bearer),本项目只对接这一个入口,无需处理 Cookie。
  2. 封面解密:封面为 AES-128-CBC 密文,Rust 侧解密后经自定义协议输出,前端 <img> 直接使用。
  3. HLS 代理:m3u8 与分片经自定义协议转发并改写 #EXT-X-KEY / 分片地址,绕开 WebView 的 CORS 与防盗链。
  4. 自定义协议:Windows 为 http://hg.localhost/*,Android 为 https://hg.localhost/*(由 Rust 侧按平台生成,避免 WebView 无法解析)。
  5. 不做签名逆向:只复用浏览器同源行为,接口字段均有文档与实测样本。

接口细节见 docs/API.md。

免责声明

License

MIT

常见问题

1. pnpm install 报 ERR_PNPM_EISDIR ... symlink

工程放在 exFAT / FAT32 盘时无法创建符号链接,保留 .npmrc 里的 node-linker=hoisted 即可。

2. tauri android build 报 Failed to create a symbolic link ... jniLibs

同样是 exFAT 不支持符号链接。可手动把 Rust 产物拷进 jniLibs,再直接跑 Gradle:

cp src-tauri/target/aarch64-linux-android/debug/libhuangguo_client_lib.so \
   src-tauri/gen/android/app/src/main/jniLibs/arm64-v8a/

cd src-tauri/gen/android
./gradlew assembleDebug        # Windows: gradlew.bat assembleDebug

产物在 src-tauri/gen/android/app/build/outputs/apk/。

3. Android 构建提示找不到 SDK / NDK

需要设置 ANDROID_HOME(Android SDK 根目录)、NDK_HOME($ANDROID_HOME/ndk/<版本>)与 JAVA_HOME(JDK 17)。

LinuxDO

https://linux.do/

HGhub (Minireel/HGhub)

Searching Database…

631 ·GitHub
What is this?An unofficial third-party client for the YellowFruit (HGhub) short-drama service, with an immersive vertical video player. It is built with Rust and Tauri 2.
Is it a desktop app, a mobile app or a library?An app, not a library. One Tauri 2 codebase builds for Windows and Android, and the README mentions no other platforms.
How do I build it?Clone the repo and run 'pnpm install', then build with Tauri. For Android you need the Android SDK and NDK installed, with ANDROIDHOME, NDKHOME and JAVAHOME (JDK 17) set.
What do I need installed first?Node.js with pnpm and Rust (the README lists Rust 1.9x). For Android add JDK 17, the SDK and the NDK. Also allow esbuild in package.json's pnpm.onlyBuiltDependencies, or vite build will fail.
Any install pitfalls?Yes. On an exFAT or FAT32 drive symlinks are not supported, so keep node-linker=hoisted in .npmrc. On such a drive you also copy the Rust build output into jniLibs by hand and run Gradle directly.
What does the Rust side handle?Networking with reqwest and rustls, decryption of AES-128-CBC encrypted covers served through a custom protocol, and HLS proxying for the WebView.
Is it free to use?The code is MIT-licensed and free. The app plays third-party content, though, and judging whether that is legal is left to you.
Creator
Minireel
Size
1.4 MB
Stars
631
Age
1d
Commits · 90 Days