Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tramhao/termusic
Music Player TUI written in Rust
https://github.com/tramhao/termusic
Last synced: about 2 months ago
JSON representation
Music Player TUI written in Rust
- Host: GitHub
- URL: https://github.com/tramhao/termusic
- Owner: tramhao
- License: gpl-3.0
- Created: 2021-06-01T08:13:53.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T00:09:02.000Z (2 months ago)
- Last Synced: 2024-04-12T07:10:11.174Z (2 months ago)
- Language: Rust
- Size: 18.8 MB
- Stars: 822
- Watchers: 5
- Forks: 41
- Open Issues: 34
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE_GPLv3
Lists
- awesome-rust - termusic
- cli-apps - termusic - Terminal Music Player written in Rust. (<a name="music"></a>Sound and music)
- awesome-cli-apps - termusic - Terminal Music Player written in Rust. (<a name="music"></a>Sound and music)
- awesome-stars - tramhao/termusic - Music Player TUI written in Rust (Rust)
README
[![Build status](https://github.com/tramhao/termusic/actions/workflows/build.yml/badge.svg)](https://github.com/tramhao/termusic/actions)
[![crates.io](https://img.shields.io/crates/v/termusic.svg)](https://crates.io/crates/termusic)
[![dependency status](https://deps.rs/repo/github/tramhao/termusic/status.svg)](https://deps.rs/repo/github/tramhao/termusic)
[![MSRV](https://img.shields.io/badge/MSRV-1.70.0-blue)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
# Terminal Music and Podcast Player written in RustListen to music and podcasts freely as both in freedom and free of charge!
![]()
![]()
**Freedom**: As time goes by, online service providers control pretty much everything we listen to.
Complicated copyright issues make things worse. If my favorite song cannot be found on a website,
I'll probably just not listen to them for years.**Free of charge**: You can download from YouTube, NetEase, Migu and KuGou for free. No need to
register for monthly paid memberships.As a contributor of [GOMU](https://github.com/issadarkthing/gomu), I met serious problems during
development. The main problem is data race condition. So I rewrote the player in rust, and hope to
solve the problem.## Supported Formats
Below are the audio formats supported by the various backends.
In the case that metadata is not supported, an attempt will still be made to play the file.
| Format (`feature`) | Symphonia (`default`) | Mpv (`mpv`) | Gstreamer (`gst`) | Metadata |
|--------------------|-----------------------|-------------|-------------------|----------|
| ADTS | Yes | Yes | Yes | No |
| AIFF | No | Yes | Yes | Yes |
| FLAC | Yes | Yes | Yes | Yes |
| M4a | Yes | Yes | Yes | Yes |
| MP3 | Yes | Yes | Yes | Yes |
| Opus | No | Yes | Yes | Yes |
| Ogg Vorbis | Yes | Yes | Yes | Yes |
| Wav | Yes | Yes | Yes | Yes |
| WebM | No | Yes | Yes | No |## Installation
### Requirements
#### MSRV
You will need to build with the stable rust toolchain. Minimal Supported Rust Version 1.70.0.=======
| Backend | Requirements |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Symphonia | You will need [ALSA](https://alsa-project.org) installed to support decoding with symphonia.
Note that the ALSA development files are required. These are provided as part of the `libasound2-dev` package on Debian and Ubuntu distributions and `alsa-lib-devel` on Fedora. |
| GStreamer | [GStreamer](https://gstreamer.freedesktop.org) |
| MPV | [MPV](https://mpv.io/) |#### Protobuf
This is required to build and run termusic. For ubuntu: `apt-get protubuf-compiler`, For arch: `paru -S protobuf`.
#### Dbus
As right now use_dbus is a configuration option, it's required to compile. For ubuntu: `apt-get libdbus-1-dev`, For arch: `paru -S dbus`.
#### Yt-dlp support
You can optionally install [yt-dlp](https://github.com/yt-dlp/yt-dlp/) and [FFmpeg](https://www.ffmpeg.org/download.html) to download MP3s from Youtube.
#### Album cover support
For kitty, album cover support is default. For other terminals, need ueberzug installed and `cover` feature flag compiled.
### Packages
Do note that these will be compiled with the **symphonia** backend.
#### Arch Linux
Arch Linux users can install `termusic` from the [AUR](https://aur.archlinux.org/) using an [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers).
```bash
paru termusic
```#### NetBSD
NetBSD users can install `termusic` from the official repositories.
```bash
pkgin install termusic
```
#### Nix/NixOSEither in the user's environment:
```bash
nix-env --install termusic
```Or declaratively in `/etc/nixos/configuration.nix`:
```nix
{
environment.systemPackagess = with pkgs; [
...
termusic
];
}
```#### Cargo
```bash
cargo install termusic termusic-server
```### From Source
```bash
git clone https://github.com/tramhao/termusic.git
cd termusic
make
```Then install with:
```bash
make install
```By default, termusic can display album covers in Kitty or iTerm2 (mac, not tested).
If you need album covers displayed on other terminals, please install [ueberzug](https://github.com/seebye/ueberzug), then:```bash
make full
```Finally, you can run it with:
```bash
~/.local/share/cargo/bin/termusic
```You can copy it anywhere in your `$PATH`. The configuration file is located in `~/.config/termusic/config.toml` (or on macOS, `~/Library/Application Support/termusic/config.toml`).
However, as this is a minimalistic program, you don't need to edit the configuration file and almost everything can be set from the app.## TODO
- [ ] Better interface to adjust timestamp of lyric.
- [ ] Rating and sync support.
- [x] Multiple root and easy switch.
- [x] Save playlists.
- [x] Listen to rss feeds/Podcasts. Need a new layout.## Contributing and issues 🤝🏻
Contributions, bug reports, new features and questions are welcome! 😉
If you have any question or concern, or you want to suggest a new feature, or you want just want to improve termusic, feel free to open an issue or a PR.Please follow [our contributing guidelines](CONTRIBUTING.md)
## Thanks
- [tui-realm](https://github.com/veeso/tui-realm)
- [termscp](https://github.com/veeso/termscp)
- [netease-cloud-music-gtk](https://github.com/gmg137/netease-cloud-music-gtk)
- [alacritty-themes](https://github.com/rajasegar/alacritty-themes)
- [shellcaster](https://github.com/jeff-hughes/shellcaster)
- [stream-download ](https://github.com/aschey/stream-download-rs)
## LicenseMIT License for main part of code.
GPLv3 for NetEase api code under `src/lyric/netease`. Comes from netease-cloud-music-gtk.
GPLv3 for Podcast code under `src/podcast`. Comes from shellcaster.