#music-player #music #youtube #player #tui

app youtui

A simple TUI YouTube Music player

17 releases

new 0.0.17 Nov 18, 2024
0.0.16 Oct 26, 2024
0.0.14 Sep 4, 2024
0.0.13 Aug 17, 2024
0.0.3 Dec 13, 2023

#50 in Audio

Download history 210/week @ 2024-08-04 269/week @ 2024-08-11 79/week @ 2024-08-18 19/week @ 2024-08-25 172/week @ 2024-09-01 21/week @ 2024-09-08 30/week @ 2024-09-15 41/week @ 2024-09-22 96/week @ 2024-09-29 17/week @ 2024-10-06 10/week @ 2024-10-13 232/week @ 2024-10-20 91/week @ 2024-10-27 22/week @ 2024-11-03 14/week @ 2024-11-10 197/week @ 2024-11-17

433 downloads per month

MIT license

760KB
18K SLoC

dependency status build

About

Youtui - a simple TUI YouTube Music player written in Rust aiming to implement an Artist->Albums workflow for searching for music, and using discoverability principles for navigation. Inspired by https://github.com/ccgauche/ytermusic/ and cmus.

Ytmapi-rs - an asynchronous API for YouTube Music using Google's internal API, Tokio and Reqwest. Inspired by https://github.com/sigma67/ytmusicapi/.

This project is not supported or endorsed by Google.

Features

  • Quickly and easily display entire artist's discography
  • Buffer upcoming songs
  • Search suggestions
  • Sorting and filtering

Demo

asciicast

Installing youtui

Packaging status

Arch Linux

paru -S youtui

FreeBSD

pkg install youtui

Cargo

cargo install youtui

Running youtui

The default option is to use browser authentication, oauth authentication is likely being phased out by Google. To change this to oauth authentication, a config.toml file can be added to the local youtui config directory (e.g ~/.config/youtui/ on Linux), with the value auth_type = "OAuth". Please note however that config file format is currently unstable and could change in the future.

Commands

  1. To run the TUI application, execute youtui with no arguments.
  2. To use the API in command-line mode, execute youtui --help to see available commands.

Browser Auth Setup Steps

  1. Open YouTube Music in your browser - ensure you are logged in.
  2. Open web developer tools (F12).
  3. Open Network tab and locate a POST request to music.youtube.com.
  4. Copy the Cookie into a text file named cookie.txt into your local youtui config directory. Note you will need to create the directory if it does not exist. Firefox example (Right click and Copy Value): image Chrome example (Select manually and paste): image

OAuth Setup Steps

  1. Setup the oauth token in the default configuration directory by running youtui setup-oauth and following the instructions.

Other Setup

  1. If music downloads always return an error, you are able to supply a PO Token by saving it to the file po_token.txt into your local youtui config directory. For more information on PO Tokens and how to obtain them, see here.

Dependencies note

General

  • A font that can render FontAwesome symbols is required.

Linux specific

  • Youtui uses the Rodio library for playback which relies on Cpal https://github.com/rustaudio/cpal for ALSA support. The cpal readme mentions the that the ALSA development files are required which can be found in the following packages:
    • libasound2-dev (Debian / Ubuntu)
    • alsa-lib-devel (Fedora)

Limitations

  • This project is under heavy development, and interfaces could change at any time. The project will use semantic versioning to indicate when interfaces have stabilised.

Roadmap

Application

  • Windows support (target for 0.0.1)
  • Configuration folder support (target for 0.0.1)
  • Implement improved download speed
  • Filtering (target for 0.0.3)
  • Release to AUR (target for 0.0.4)
  • Remove reliance on rust nightly (target for 0.0.4)
  • OAuth authentication including automatic refresh of tokens
  • Seeking
  • Logging to a file (basic version implemented - use -d flag)
  • Gapless playback (blocked - requires symphonia AAC gapless support)
  • Dbus support for media keys
  • Mouse support
  • Offline cache
  • Streaming of buffered tracks
  • Display lyrics and album cover (pixel art)
  • Theming
  • Configurable key bindings

API

  • Document public API
  • OAuth authentication
  • Implement endpoint continuations
  • Implement all endpoints
  • Automatically update User Agent using a library
  • i18n

Feature parity with ytmusicapi

Endpoint Implemented: Query Implemented: Continuations
GetArtist [x]
GetAlbum [x]*
GetArtistAlbums [x]
Search [x] [ ]
GetSearchSuggestions [x]
GetHome Not Planned*
GetAlbumBrowseId [ ]
GetUser [ ]
GetUserPlaylists [ ]
GetSong [ ]*
GetSongRelated [ ]
GetLyrics [x]
GetTasteProfile [x]
SetTasteProfile [x]
GetMoodCategories [x]
GetMoodPlaylists [x]
GetCharts Not Planned*
GetWatchPlaylist [x]* [ ]
GetLibraryPlaylists [x] [x]
GetLibrarySongs [x] [x]
GetLibraryAlbums [x] [x]
GetLibraryArtists [x] [x]
GetLibrarySubscriptions [x] [x]
GetLibraryPodcasts [ ] [ ]
GetLibraryChannels [ ] [ ]
GetLikedSongs [ ] [ ]
GetSavedEpisodes [ ] [ ]
GetHistory [x]
AddHistoryItem [x]
RemoveHistoryItem [x]
RateSong [x]
EditSongLibraryStatus [x]
RatePlaylist [x]
SubscribeArtists [ ]
UnsubscribeArtists [ ]
GetPlaylist [x] [ ]
CreatePlaylist [x]
EditPlaylist [x]
DeletePlaylist [x]
AddPlaylistItems [x]
RemovePlaylistItems [x]
GetChannel [*]
GetChannelEpisodes [*]
GetPodcast [*] [ ]
GetEpisode [*]
GetEpisodesPlaylist Not Planned*
Original: GetNewEpisodes [*]
GetLibraryUploadSongs [x] [ ]
GetLibraryUploadArtists [x] [ ]
GetLibraryUploadAlbums [x] [ ]
GetLibraryUploadArtist [x] [ ]
GetLibraryUploadAlbum [x]
UploadAlbum [ ]
DeleteUploadEntity [x]

* GetWatchPlaylist is partially implemented only

  • only returns playlist and lyrics ids

* GetArtist is partially implemented only

  • only returns albums and songs

* Only the tracking url from GetSong is implemented - as GetSongTrackingUrl. Any additional features for GetSong are not currently planned - recommend taking a look at rusty_ytdl library for these features.

* Note, significantly dynamic pages, such as Get Home are not currently planned.

* GetEpisodesPlaylist is not implemented - it seems the only use case is to get the New Episodes playlist, which has been implemented instead as GetNewEpisodes.

Developer notes

See the wiki for additional information https://github.com/nick42d/youtui/wiki

Dependencies

~44–81MB
~1.5M SLoC