socatlolmeow/drift
소개
A modern, configurable YouTube Music terminal client with Vim controls, Last.fm scrobbling and more.
디자인 및 미디어What you can do
- Vim-style keybinds: j/k, gg/ge, counts like 5j, and : for the command line
- Synced lyrics in a side panel or fullscreen, with the current line filled in as it's sung, plus a cover art view with track details and progress
- Queue and playlists: build a queue, save and reorder playlists, or import any YouTube / YouTube Music playlist by URL
- Liked Songs: press f to heart a song. Liked songs get a ♥ everywhere and are collected in their own playlist
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +10
- in 15 days
- +38
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalDrift
A YouTube Music player for your terminal, with Vim keybinds.
Search, queue and play music with no account, no login and no browser.

Quick start: install Drift, then run:
drift "daft punk"
Press Enter to play, a to queue, f to like a song and ? for every keybind.
Table of contents
- Features
- Installation
- Usage
- Keybinds
- Commands
- Sleep timer
- Liked songs
- Lyrics
- MPRIS and playerctl
- Configuration
- Troubleshooting
- Contributing
- License
Features
- Vim-style keybinds:
j/k,gg/ge, counts like5j, and:for the command line - Synced lyrics in a side panel or fullscreen, with the current line filled in as it's sung, plus a cover art view with track details and progress
- Queue and playlists: build a queue, save and reorder playlists, or import any YouTube / YouTube Music playlist by URL
- Liked Songs: press
fto heart a song. Liked songs get a ♥ everywhere and are collected in their own playlist - Listening history: Recently Played and Most Played tabs, with persistent play counts
- Discovery:
gafor an artist's songs,gsfor similar songs,gbfor the album, and:album/:playlistto search for albums and playlists - Song menu and command palette:
Gfor per-song actions, and:for commands like:search,:seek,:voland:import, with completion and history - Downloads: save songs, albums or playlists as audio files
- Session restore: your queue and position come back the next time you start Drift
- Media keys and
playerctlon Linux (MPRIS), plus optional Discord rich presence and Last.fm and ListenBrainz scrobbling - One TOML file for volume, seek step, shuffle/repeat defaults, accent color, custom keybinds, audio streaming options and Discord rich presence
Installation
Drift needs mpv for playback and yt-dlp to get the audio streams. Run drift --check at any time to see if both are installed.
Prebuilt binaries
Download the archive for your system (Linux or macOS, x86_64 or ARM) from the latest release, then extract it and put drift somewhere on your $PATH:
tar xzf drift-*.tar.gz
sudo mv drift-*/drift /usr/local/bin/
You still need mpv and yt-dlp, see below. Each archive has a .sha256 file next to it if you want to verify the download.
Arch Linux (AUR)
yay -S driftmusic-git
Any AUR helper works. You can also build it by hand:
git clone https://aur.archlinux.org/driftmusic-git.git
cd driftmusic-git
makepkg -si
mpv and yt-dlp are pulled in automatically.
Install script
Works on Arch, Debian/Ubuntu, Fedora, openSUSE, Void, Alpine and Gentoo. It installs the dependencies and builds Drift with cargo.
git clone https://github.com/socatlolmeow/drift.git
cd drift
./install.sh
From source
Install the dependencies and Rust, then:
git clone https://github.com/socatlolmeow/drift.git
cd drift
cargo install --path .
This puts drift in ~/.cargo/bin/, which is on your $PATH if you installed Rust with rustup.
Nix
The repo has a flake that puts mpv and yt-dlp on Drift's PATH for you:
nix run github:socatlolmeow/drift
Installing mpv and yt-dlp manually
| Platform | Command |
|---|---|
| Debian / Ubuntu | sudo apt install mpv and pipx install yt-dlp |
| macOS | brew install mpv yt-dlp |
| Arch | sudo pacman -S mpv yt-dlp |
| Windows | winget install mpv.net yt-dlp.yt-dlp or scoop install mpv yt-dlp |
Usage
drift # start the player
drift "daft punk" # start with a search
drift --check # check that mpv and yt-dlp are installed
drift --completions zsh # print a shell completion script
drift --help
drift --version
Press / to search, Enter to play, a to add a song to the queue and ? for the full list of keybinds. Inside the player, :help lists the commands.
Shell completions
drift --completions <shell> prints a completion script for bash, zsh, fish, elvish or powershell. For example:
drift --completions bash > ~/.local/share/bash-completion/completions/drift
drift --completions zsh > ~/.zfunc/_drift
drift --completions fish > ~/.config/fish/completions/drift.fish
For zsh, ~/.zfunc must be in your fpath before compinit runs. Restart your shell afterwards.
Keybinds
These are the defaults. You can change them, see Custom keys.
| Key | Action |
|---|---|
j k / ↓ ↑ |
move (counts work: 5j) |
gg ge |
jump to top / bottom (5gg goes to row 5) |
Tab Shift-Tab |
cycle Results / Queue / Playlists |
gr gq gp |
jump to Results / Queue / Playlists |
Enter |
play the selected song |
Space |
pause / resume |
n N |
next / previous track |
h l / ← → |
seek back / forward (counts: 6l) |
+ - |
volume up / down |
s r |
toggle shuffle / cycle repeat |
a A P |
queue the song / queue all results / play all results |
dd x |
remove from queue or playlist |
J K |
move a queue or playlist item down / up |
f |
like / unlike the highlighted song (or the playing one) |
G |
song menu |
ga |
go to the artist |
gs |
see similar songs |
gb |
go to the album |
gB |
save the album as a playlist |
D |
download the current song |
gd |
download the highlighted song |
gD |
download the whole album, playlist, queue or loaded results |
L |
toggle the lyrics panel |
F |
cycle fullscreen lyrics → cover art and lyrics → stage view → card view → player |
/ : |
search / command line |
? |
help |
q |
quit |
Commands
Press : to open the command line. Most commands have short aliases (:vol, :sa, :ar and so on).
| Command | Action |
|---|---|
:search "query" |
search YouTube Music |
:play [N] |
play or resume, or play row N |
:pause :resume :toggle :stop |
control playback |
:next :prev |
next / previous track |
:seek 90 1:30 +10 |
absolute or relative seek |
:vol 50 +5 |
set or change the volume |
:speed 1.25 +0.25 reset |
playback speed from 0.25x to 4x (alias :spd) |
:sleep 30 song off |
stop playback after 30 minutes or after the current song; off cancels |
:shuffle :repeat [off|all|one] |
playback modes |
:add [N] :addall :playall |
queue results |
:download [current|selected|all] |
download audio files (defaults to the current song; alias :dl) |
:remove [N] :clear |
remove from the queue / clear it |
:save name :load name :append name |
work with playlists |
:save! name |
save and overwrite an existing playlist |
:savealbum [name] :saveresults [name] |
save an album or the results directly as a playlist |
:addto name :delpl name |
add a song to / delete a playlist |
:like :unlike |
add the selected song to / remove it from Liked Songs |
:import URL |
import a YouTube / YouTube Music playlist |
:album [query] |
open the selected song's album, or search albums |
:playlist query |
search YouTube Music playlists |
:similar |
songs similar to the selected one (also :radio) |
:artist |
songs by the selected song's artist |
:results :queue :playlists |
switch view |
:lyrics |
toggle the lyrics panel |
:quit |
quit |
:save refuses to overwrite an existing playlist. Use :save! to replace it or :append to add to the end of it.
Sleep timer
:sleep 30 stops playback after 30 minutes (1 to 1440). :sleep song stops it when the current song ends, even with repeat-one on. :sleep off cancels the timer, and :sleep on its own shows what is set.
The time left shows in the player bar. Stopping playback by hand also ends the timer, and the timer isn't saved between sessions. It stops playback the same way :stop does, so your queue stays as it was.
Liked songs
Press f on a song to like it. Press f again to unlike it. You can also use :like and :unlike, or pick Like / Unlike in the song menu (G).
- Which song: the highlighted one, or the playing song when nothing is highlighted (for example on the playlist list). In fullscreen lyrics and the cover view,
falways acts on the playing song. - The heart: liked songs show a red ♥ in the Results, Queue, playlist and history lists, next to the artist in the player bar, and in the cover view (♡ when the song isn't liked).
- The playlist: liked songs are saved in a playlist called Liked Songs, which is always first in the Playlists tab. It works like any other playlist: open it, play it with
:load Liked Songs, download it withgD, reorder it withJ/K. New likes go to the end, and removing a song from it unlikes it. - Commands are not toggles:
:likeon a liked song and:unlikeon a song that isn't liked do nothing, so they are safe in scripts and key sequences.
Likes are stored with your other playlists, in playlists.json. Deleting the Liked Songs playlist removes all your likes. If you already have a playlist named exactly Liked Songs, Drift uses it as your likes list.
Lyrics
Press L for a side panel (needs a terminal at least 70 columns wide). Press F to cycle through fullscreen lyrics, cover art and lyrics, the stage view, the card view, and back to the player. Esc, q or L also closes any fullscreen view.
The cover view shows square artwork, the song title, artist and album, and a progress bar with elapsed and remaining time on the left. Lyrics appear on the right, with the current line kept near the middle and surrounding lines fading with distance. This view hides the bottom player bar to give the artwork and lyrics more room.
The stage view is a centered "now playing poster": the cover on top, then the title (with its heart), artist, album and progress bar, and a small window of lyrics underneath with the current line in the middle. Like the cover view it hides the bottom player bar. On short windows the cover is dropped first, then the lyric window shrinks.
The card view is the wide version: the cover on the left and, next to it, a "playback state (playing, paused or loading), the title (with its heart on the right), artist, album, a small window of lyrics and the progress bar. It also hides the bottom player bar, and falls back to the stage view when the window is too small (roughly under 65 columns or 15 rows).
In the lyrics and cover views the current line gets bold, white text on a dark neutral band with extra breathing room, while nearby lines fade with distance. It fills in as it's sung. Songs without synced lyrics show plain text that you can scroll with j/k.
All the fullscreen views keep playback controls available: Space to pause or resume, h/l or the arrow keys to seek, n/N to skip tracks, +/- for volume, s for shuffle, r to cycle repeat and f to like the song.
Lyrics come from LRCLIB and are only fetched while the panel or fullscreen view is open.
Artwork comes from YouTube thumbnails and is only fetched when the cover view is open. Drift trims black bars and crops and resizes the image to 1000 × 1000 pixels. Terminals detected as supporting the Kitty or iTerm2 graphics protocol show the image directly; other terminals use colored half blocks for a rough preview. The cover is hidden in very short windows to leave room for track details.
MPRIS and playerctl
Drift registers as an MPRIS player on Linux, so your current song can appear in Waybar, your desktop's media controls and anything else that speaks MPRIS, and you can control playback with playerctl and your media keys.
A step-by-step guide covers setup for Waybar and other status bars, media key bindings and troubleshooting.
Configuration
Settings live in config.toml inside Drift's config directory (~/.config/drift/ on Linux). Drift only reads the file and never rewrites it, so your comments are safe. Restart Drift after editing.
[playback]
volume = 80
shuffle = false
repeat = "off" # off, all or one
autoplay = false
restore_session = true
seek_step = 5.0
volume_step = 5.0
[artist]
popular_first = false
[ui]
accent = "cyan" # a color name or a hex value like "#FF8800"
[discord]
client_id = "" # set this to enable Discord rich presence
[lastfm]
api_key = "" # set both to enable Last.fm scrobbling, then run `drift --lastfm-login`
api_secret = ""
[listenbrainz]
token = "" # set this to enable ListenBrainz scrobbling
[audio]
download = false # false: stream songs; true: download to the cache first
download_max_minutes = 15 # with download = true, longer songs are still streamed (0 = no limit)
download_dir = "~/Music/drift" # The directory where songs are saved.
cookies_from_browser = "" # e.g. "firefox" or "chrome"; passed to yt-dlp when YouTube blocks playback
stream_from_client = "" # e.g. "android_vr" - the client passed to yt-dlp to stream songs
Keybinds go in a [keys] section, see Custom keys. If you already have a config.toml from an older version, add the [audio], [lastfm] and [listenbrainz] sections by hand, since Drift never rewrites the file.
Streaming or downloading
By default Drift streams songs, so playback starts right away, even for hour-long tracks. With download = true songs are cached on disk first, and the next song in the queue is fetched in the background while the current one plays.
Saving songs permanently
Set download_dir under [audio] in config.toml (default: ~/Music/drift). The directory is created when needed. ~ expands to your home directory; relative paths resolve from the directory where you start Drift. Restart Drift after changing it.
- Press
Dto download the current song, including from fullscreen lyrics or cover art. - Press
gdto download the highlighted song without changing playback. - Press
gDto download all songs in the open album, playlist or queue. On the playlist list, it downloads the highlighted playlist. For search results and history, it downloads all currently loaded songs. - In an album/playlist search picker, press
dto download the entire collection. To download one song instead, pressEnter, highlight the song, then pressgd. - The
Gcontext menu also offersdfor one song andDfor the whole list. - Commands:
:download(current song),:download selected, and:download all.:dlis an alias.
Downloads run in the background, one batch at a time, with progress and a completion summary. Duplicate songs within a batch are downloaded once, existing files are kept, and a failed song does not stop the rest. Keep Drift open until the batch finishes.
Files use the best available audio-only format in its original container, such as .webm or .m4a; no MP3 conversion or ffmpeg is required. Permanent downloads are separate from the playback cache: they work regardless of audio.download or download_max_minutes, use cookies_from_browser when configured, and are never automatically pruned.
Discord rich presence
This is off by default.
- Create an application at https://discord.com/developers/applications.
- Copy the Application ID into
client_idunder[discord]inconfig.toml. - Restart Drift.
Your status then shows the current song with cover art, album, a progress bar and a "Listen Along" button. If Discord isn't running, Drift keeps retrying quietly in the background.
Last.fm scrobbling
This is off by default. Last.fm gives every application its own API key, so you create one for Drift:
- Create an API account at https://www.last.fm/api/account/create (any name works, the callback URL can stay empty).
- Copy its API key and shared secret into
api_keyandapi_secretunder[lastfm]inconfig.toml. - Run
drift --lastfm-login, open the link it prints, allow access and press Enter. Your password is never seen by Drift. - Start Drift.
drift --lastfm-logoutsigns out again.
Drift follows Last.fm's rules: the current song is sent as "now playing" when it starts, and a play is scrobbled once the song is longer than 30 seconds and you have listened to half of it or four minutes, whichever comes first. Seeking, pausing and playback speed are accounted for, and repeat-one scrobbles every round. The primary artist of a song is submitted, not the joined credit.
Requests run in the background and never slow the player down. Scrobbles that cannot be delivered (offline, Last.fm down) are kept in lastfm_queue.json in the state directory and retried with backoff, also after a restart, for up to 14 days, which is as far back as Last.fm accepts. The session key is stored in lastfm.json next to config.toml, readable only by you; the shared secret lives in config.toml, so keep that file private. If Last.fm rejects your credentials, Drift shows a message and stops scrobbling until you log in again.
ListenBrainz scrobbling
This is off by default, and it can run next to Last.fm. ListenBrainz has no application keys and no sign-in step, you only need your user token:
- Sign in at https://listenbrainz.org and copy your user token from https://listenbrainz.org/settings/.
- Paste it into
tokenunder[listenbrainz]inconfig.toml. - Start Drift.
Plays are judged by the same rules as for Last.fm (see above) and the current song is sent as "now playing" when it starts. The song's duration is included when it is known.
Requests run in the background. Scrobbles that cannot be delivered are kept in listenbrainz_queue.json in the state directory and retried with backoff, also after a restart. ListenBrainz accepts listens of any age, so they are kept until delivered. The token gives access to your listens, so keep config.toml private. If ListenBrainz rejects the token, Drift shows a message and stops sending until you restart it with a working token.
Custom keys
To change keys, add a [keys] section to config.toml. Each line sets an action to one key or a list of keys and replaces that action's default keys. Everything you leave out keeps its default.
[keys]
quit = "ctrl+q"
move_down = ["j", "down", "ctrl+n"]
move_up = ["k", "up", "ctrl+p"]
go_top = ["gg", "home"]
shuffle = [] # an empty list unbinds the action
A key is a character ("x", "G", "/"), a name (space, enter, esc, tab, backtab, backspace, delete, insert, home, end, pageup, pagedown, up, down, left, right, menu, f1 to f12), ctrl+ plus a key, or a sequence like "gg" or "ctrl+x g". Counts (5j) keep working on any binding. If you bind a key that is a default of another action, the other action loses it. A mistake in [keys] shows a message at startup and falls back to the default keys.
| Action | Default keys |
|---|---|
move_down move_up |
j down / k up |
half_page_down half_page_up |
ctrl+d / ctrl+u |
page_down page_up |
ctrl+f pagedown / ctrl+b pageup |
go_top go_bottom |
gg home / ge end |
next_view prev_view |
tab / backtab |
view_results view_queue view_playlists |
gr / gq / gp |
toggle_queue_sidebar |
Q |
activate |
enter |
pause |
space |
next prev |
n > / N < |
seek_back seek_forward |
h left / l right |
volume_up volume_down |
+ = / - _ |
add add_all play_all |
a / A / P |
delete |
x delete dd |
move_item_down move_item_up |
J / K |
shuffle repeat |
s / r |
like |
f |
menu |
G menu |
go_artist go_similar go_album save_album |
ga / gs / gb / gB |
download download_selected download_all |
D / gd / gD |
lyrics_panel lyrics |
L / F |
search command |
/ / : |
help |
? |
quit |
q |
back |
backspace esc |
In the Playlists tab seek_forward opens the selected playlist, and seek_back or back leaves it. Only the main view is remappable. Popups, the command line and fullscreen lyrics keep their own keys, and the in-app help (?) still lists the defaults.
Environment variables
| Variable | What it does |
|---|---|
DRIFT_CONFIG_DIR |
where Drift keeps config.toml and your playlists |
DRIFT_STATE_DIR |
where Drift keeps the saved session |
DRIFT_MPV_ARGS |
extra arguments passed to mpv |
Troubleshooting
Drift says mpv or yt-dlp is missing. Run drift --check to see which one, and install it with the table in Installing mpv and yt-dlp manually.
Playback fails with "Sign in to confirm you're not a bot". YouTube wants a login. Set cookies_from_browser under [audio] to a browser you're logged into YouTube with (for example "firefox"), then restart Drift. Updating yt-dlp also helps, since YouTube changes things often.
Songs are slow to start or fail to load. Update yt-dlp first, since YouTube changes often. If it keeps happening, try setting stream_from_client under [audio] (for example "android_vr") and restart Drift.
The lyrics panel doesn't show up. It needs a terminal at least 70 columns wide. Make the window wider or use F for fullscreen lyrics.
Cover art looks blocky or is missing. Press F twice from the player to open the cover view. A blocky preview means Drift couldn't detect Kitty or iTerm2 graphics support in your terminal. If you see "Cover art unavailable", the YouTube thumbnail couldn't be fetched or decoded. In very short windows, make the terminal taller to show the cover.
Plays don't show up on Last.fm. Check that Drift didn't show a Last.fm message in the status line, that api_key and api_secret are both set, and that drift --lastfm-login succeeded. Songs shorter than 30 seconds are never scrobbled, and Last.fm can take a minute to show new plays.
Plays don't show up on ListenBrainz. Check that Drift didn't show a ListenBrainz message in the status line and that the token under [listenbrainz] is your current user token. Songs shorter than 30 seconds are never scrobbled, and new listens can take a minute to appear.
drift: command not found. Make sure ~/.cargo/bin is in your $PATH.
gb opens the wrong album. Drift looks albums up by album and artist name, so it can guess wrong, and the song needs album info to begin with. :album <query> lets you search for it yourself.
You can run several Drift windows at once. Only the first one restores and saves the session, and playlists saved from different windows are merged instead of overwritten.
Contributing
Bug reports, ideas and pull requests are welcome. Read CONTRIBUTING.md before you start. To build and run the tests:
cargo build
cargo test
Recent changes are listed in CHANGELOG.md.
License
Drift is free software, released under the GNU General Public License version 3 or later.
Drift is not affiliated with YouTube, YouTube Music or Google.
관련 프로젝트 살펴보기
불러오는 중…