spotube README

项目的 README,来自 github.com/team-spotube/spotube。合并为一个 markdown 文件:README.md。

Spotube Logo

A cross-platform extensible open-source music streaming platform.
Bring your own music metadata/playlist/audio-source with plugins created by community or by yourself. A small step towards the decentralized music streaming era!

Visit the website Discord Server

Support me on Patron Buy me a Coffee

HackerNews

Donate to our Open Collective


Spotube Desktop Spotube Mobile

****

🌃 Features

⬇️ Download

Download Spotube from the Official Website: https://spotube.org

🔄 Nightly Builds

Grab the latest nightly builds of Spotube from the Offical Website.

🕳️ Building from source [Click to expand]


GitHub Workflow Status

Spotube is a Compose Multiplatform app.

1. Prerequisites

  • JDK 21 to run Gradle (the Gradle daemon JDK and GraalVM are provisioned automatically).

  • Rust (rustup + cargo), for the composeApp library built through Gobley.

  • Android SDK, only for Android builds.

  • ComposeNativeWebview, which isn't on Maven Central yet. Clone it at the commit pinned as COMPOSE_WEBVIEW_COMMIT in spotube-release-binary.yml and run ./gradlew publishToMavenLocal in it.

  • Linux only: runtime libraries, including VLC. Needed to run the app, including :composeApp:run:

    Distro Command
    Debian/Ubuntu sudo apt-get install libvlc5 vlc-plugin-base libwebkit2gtk-4.1-0 libgtk-3-0 libasound2 libgl1 libxtst6 libxi6 libxrender1
    Fedora sudo dnf install vlc-libs webkit2gtk4.1 gtk3 alsa-lib mesa-libGL libXtst libXi libXrender (vlc-libs needs RPM Fusion)
    Arch / CachyOS / Manjaro sudo pacman -S vlc webkit2gtk-4.1 gtk3 alsa-lib libglvnd libxtst libxi libxrender
    openSUSE sudo zypper install libvlc5 libwebkit2gtk-4_1-0 libgtk-3-0 libasound2 Mesa-libGL1 libXtst6 libXi6 libXrender1

    On Ubuntu 24.04+/Debian 13, libgtk-3-0 and libasound2 are libgtk-3-0t64 and libasound2t64; apt resolves this itself.

2. Run in development

Desktop (JVM), fastest edit/run loop

./gradlew :composeApp:run

Android debug APK

./gradlew :composeApp:assembleStableDebug

Use ./gradlew :composeApp:assembleNightlyDebug for the nightly channel.

Development builds stay fast: the release-only optimizations below are skipped.

3. Build the desktop app

A native build takes about 10 minutes, uses every CPU core and peaks at ~15 GB of RAM. It only happens for the tasks below, never for run.

Native toolchain (Nucleus downloads GraalVM CE on the first build; set GRAALVM_HOME to use your own):

OS Requirements
Linux gcc, zlib headers, patchelf; rpm for .rpm, fuse + zstd for .AppImage.
Debian/Ubuntu: sudo apt-get install build-essential zlib1g-dev patchelf rpm fuse zstd.
Fedora: sudo dnf install gcc zlib-devel patchelf rpm-build fuse zstd
macOS Xcode Command Line Tools (xcode-select --install)
Windows Visual Studio Build Tools with "Desktop development with C++" (use an "x64 Native Tools" prompt if native-image can't find MSVC)

Build and run the app folder:

./gradlew :composeApp:createGraalvmNativeDistributable

Output folder: composeApp/build/compose/binaries/main/graalvm-app/

Build and launch in one step

./gradlew :composeApp:runGraalvmNativeDistributable

Keep the spotube binary next to the libraries it was built with; it loads them from its own folder.

Installers (each OS builds only its own):

OS Command
Linux ./gradlew :composeApp:packageGraalvmDeb :composeApp:packageGraalvmRpm
Linux (AppImage) ./gradlew :composeApp:packageGraalvmAppImage -PappImage=true
Windows ./gradlew :composeApp:packageGraalvmExe (or packageGraalvmMsi)
macOS ./gradlew :composeApp:packageGraalvmDmg

Output folder: composeApp/build/compose/binaries/main/graalvm-<format>

[!Tip] Add -Pnightly=true for the nightly channel (separate icons and name).

How the Linux AppImage bundle works
  • DownloadLinuxGtkBundleTask downloads the Ubuntu 24.04 packages (audio-only VLC via vlcj-bundler, GTK 3, WebKitGTK 4.1, glib-networking), keeps only what GTK/WebKit reach and relocates the libraries with patchelf. Needs ar, tar, zstd, readelf, patchelf.
  • WebKitGTK has its helper-process path compiled in, so AppImageEnvironment patches it to a relative path and moves to that directory at startup. It also sets GIO_EXTRA_MODULES and WEBKIT_DISABLE_DMABUF_RENDERER=1 (the bundled WebKitGTK 2.44 never paints against a newer host Mesa).
  • main() must call GraalVmInitializer.initialize() first: the VLC loader and the environment setup read compose.application.resources.dir.

4. Native build breaks, JVM works

A native image is a closed world: everything reached through reflection, JNI or JNA (vlcj, Zipline, NewPipe, ktor, datastore, ...) must be declared at build time. Nucleus generates most of it; the rest lives in composeApp/graalvm/reachability-metadata.json.

Symptoms: ClassNotFoundException, NoSuchMethodException or MissingReflectionRegistrationError in the native binary, while :composeApp:run works.

  1. ./gradlew :composeApp:runWithNativeAgent starts the app on the JVM with GraalVM's tracing agent.
  2. Use the broken feature, then close the window normally. Ctrl+C discards the recording.
  3. Commit the updated JSON in composeApp/graalvm/ and rebuild.

[!Tip] ./gradlew :composeApp:runGraalvmNative is a faster debug loop: a quick -Ob build that names the missing registration.

[!Warning] Keep the hand-written uk.co.caprica.vlcj.binding.lib.LibVlc entry, or playback fails to initialize.

5. Production vs development builds

Production mode turns on automatically for package*, create*, notarize* and nativeImageCompile tasks. Force it with -Pproduction=true|false.

Area Development Production
Rust lib fast debug profile release with LTO and stripping (31 MB → 1.8 MB)
Desktop app hot-reloadable JVM app size-optimized (-Os) GraalVM native image
Native libs all host OS/CPU only; Skia loaded from lib/; on Linux ~10 KB libjvm.so/libjava.so shims instead of the JDK's 28 MB one

Android picks the Rust profile from its build type.

6. Releases

Run spotube-release-binary.yml manually (workflow_dispatch) as stable, beta or nightly.

  • Beta: the stable build as a draft, tagged v<version>-beta.N. Set betaNumber in composeApp/build.gradle.kts to N, and back to null for stable.
  • Desktop: each platform (Linux x86_64 and aarch64, Windows, macOS Apple silicon and Intel) builds its installers on its own runner.
  • Android: a signed APK.

📚 Resources

Core stack

Desktop and native

Plugins

👥 The Spotube team

💼 License

Spotube is open source and licensed under the AGPL-3.0-or-later License.

© Copyright Spotube 2026

spotube (team-spotube/spotube)

正在搜索数据库…

这是什么?Spotube 是一款开源的跨平台音乐流媒体应用,支持桌面端和移动端。它允许你通过插件接入自己的音乐元数据、播放列表和音频来源,而不是依赖某个锁定的单一后端。
这只是另一个音乐服务的 Electron 套壳吗?不是。它使用 Flutter 构建以获得原生性能,并明确表示自己不是 Electron 应用。它是一个由插件驱动的客户端,通过你配置的任意后端进行流媒体播放,而不是自己托管音乐库。
我该如何在我的平台上安装?每个操作系统都有对应的安装包:Linux 上有 Flatpak、.deb/.rpm 或 AUR;macOS 上有 Homebrew cask;Windows 上有 choco、scoop 或 winget;Android 上有 APK 和 F-Droid;iOS 上则是需要侧载的 IPA 文件。每日构建版本发布在 GitHub Releases 上。
我需要先安装什么吗,比如 MPV?没有单独说明需要手动安装的前置条件。Spotube 内置 MPV 作为其播放引擎,并在构建时引入基于 Flutter 的软件包,因此你只需要使用对应操作系统的安装方式即可。
我能直接从 App Store 或 AppImage 获取它吗?不能。iOS 版只提供需要手动侧载的 IPA 文件,而 AppImage 版本因稳定性问题曾被暂时下架。
Spotube 会追踪我的收听记录或把数据发送到别处吗?不会。该应用明确避免遥测和诊断功能,播放控制在你的设备本地完成,而不是在远程服务器上进行。
插件系统到底是如何工作的?Spotube 由插件驱动,因此任何音乐平台或自定义服务都可以通过社区开发的插件或你自己编写的插件接入,让你自由选择音频来源,而不会被绑定到某一个提供商。
底层是什么在支撑基于 YouTube 的流媒体播放?它使用注重隐私的 YouTube 前端和提取器,例如 Piped、Invidious、yt-dlp、NewPipeExtractor 和 YouTubeExplodeDart,无需官方 YouTube API 密钥即可获取音频。
它支持同步歌词吗?支持。无论音频由哪个插件提供,时间同步歌词都可以正常使用,背后由 LRCLib 等服务提供支持。
曲目元数据和 scrobbling 的数据来自哪里?元数据来自 MusicBrainz,收听历史及类似 scrobbling 的功能则由 ListenBrainz 和 Last.fm 提供。
大小
162.5 MB
星标
51K
时长
5年
提交 · 90 天