[Open Source] BBHouse: A Cross-Platform Bilibili Client Built with Tauri, Vite + Vue 3, and Rust

· 67 views

Translated by AI from 中文 · View original

This post was recovered from Internet Archive snapshots; some images may be lost.

endcloud/bbhouse-tauri

Situation

  1. Following too many creators (2000+), making it impossible to quickly and effectively get through all the feed updates and videos
  2. The Bilibili web version is too resource-heavy; opening 20-30 video tabs causes the new Edge to crash outright
  3. The recently appearing random PCDN makes me, a Premium member, very annoyed
  4. Using BBDown via CMD is a bit troublesome

Target

  1. Support viewing subscribed feed updates by category
  2. Native client, preferably cross-platform
  3. Replace PCDN
  4. Wrap BBDown commands

Actions

  1. Because I had some .NET experience (the main tech stack at my previous job was ASP.NET Core), and had previously practiced with MVVM frameworks like SwiftUI and Android Compose, I tried reading the source code of several well-known third-party Bilibili clients (BiliLite, 哔哩), but was quickly discouraged by XAML's verbose syntax—especially since even Rider's support for XAML isn't very complete, which drove me nuts.
  2. I tried learning C++ and Qt from scratch for a week, but progress was far from ideal, so I temporarily gave up.
  3. I remembered that Android Compose, which I had used before, had a Desktop version, compose-jb. I explored it for a week and made some progress, but the toolchain was too primitive; many packages only worked under dev-daily, there were quite a few bugs, and some components wrapped based on Swing performed poorly, so I gave up.
  4. While watching a compose-jb tutorial, I saw Tauri in the comments. I checked its introduction: the goal is to replace Electron (since I was pursuing Native from the start, I ruled out Electron outright). Looking more closely, the backend uses Rust instead of node as the bridge for communicating with the operating system. I'd heard of Rust's reputation for years; it's inevitably labeled as high-performance, so I decided to give it a try.
  5. While learning Tauri, I learned about Vue 3 and Vite. After trying them, I was impressed by the speed, and with the additional goal of learning Vue 3, I settled on the development platform.

Result

  1. All targets were achieved
  2. Multi-platform releases are automatically built with GitHub Actions.
  3. Tauri's Shell component lacks Chinese support; the development version has already been updated, waiting for an upstream update

Readme

Tauri Cross-Platform Bilibili Client Player

Although it's called a client, it actually only implements playback- and feed-related features… because I basically don't use other features. I personally can't resist recommendation feeds, so I never look at the home pages of the mobile or Web versions either.

I first tried reading the source code of several well-known third-party Bilibili clients (BiliLite, 哔哩). That XAML syntax was too painful, and it couldn't be cross-platform; I personally spend a little less than half my time using a Mac.

After some twists and turns, I came to know Tauri.
Built with Tauri + Vite + Vue 3, it also serves as my personal practice project for learning Vue 3.

  • Core playback functionality and danmaku support come from DPlayer.js
  • The API comes from the public GitHub repository bilibili-API-collect
  • Rust starts a local proxy to fetch streams

feature

  • Minimalist: only video feed and playback features; no recommendation feed; no Bilibili posts
  • Supports filtering video feed by category | title | creator
  • Single-page player with playlist support
  • Replaces the randomly appearing PCDN
  • Simple wrapper around BBDown
  • Excellent performance and very low resource usage; in actual testing on WIN 11, startup speed is comparable to native UWP
  • Cross-platform; installers for macOS, Ubuntu, and Win have already been released
  • Light/dark theme support

Issues

  • dplayer does not support muxing. I use its event mechanism together with native audio to implement muxing in a simple way; audio/video desync may occur (mostly when switching videos), and pausing and resuming playback can alleviate it
  • The comment section and danmaku blocking lack advanced features and can only support simple browsing

todo

  • Use Rust + WASM to solve playback muxing and improve DPlayer's danmaku engine
  • Improve the comment section and add distinctive features—user background checks and comment content deduplication
  • Integrate Bilibili subtitles
  • Multi-window playback mode
  • Custom plugin support
  • May implement other feature modules

Repository

GitHub: bbhouse-tauri

Comments