Last active
December 11, 2022 14:52
-
-
Save pr0PM/7142723e97e8904400b730e07cfa59d1 to your computer and use it in GitHub Desktop.
Find and stream the song you wish to listen directly from terminal ft. bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
# dependencies: | |
## mpv | |
## youtube-dl | |
mpv --player-operation-mode=pseudo-gui "$(yt-dlp "ytsearch: $*" -g | sed -n '2p')" & | |
# sed -n '2p' | |
# to select the second line of output from the search results of | |
# youtube-dl which is the link to audio file in best format. | |
# psudo-gui mode to get the mpv gui and running it in bg to get the | |
# prompt back in terminal | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment