ytms is a command-line script for Powershell that uses yt-dlp to query YouTube and play the audio of the first result using mpv.
Note: ytms is untested on non-Windows operating systems. If you encounter any issues, feel free to file an issue.
If you already have yt-dlp and mpv installed, skip to the next step. If you don't, download mpv from here and yt-dlp from here.
Now you can install ytms by running the following command in powershell (note that powershell comes preinstalled on most modern versions of Windows. If you are not on Windows, or it didn't come preinstalled, you can download it here).
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Atrament1s/ytms/master/script.ps1 | Select-Object -ExpandProperty Content | Add-Content -Path $profileTo play a song/video, simply type ytms <query> where <query> is what should be queried by the program.
If I wanted to play Flashed Junk Mind by Milky Chance, I can simply type the song name after ytms.
ytms flashed junk mindIf I wanted to play Again by Crusher-P, it is unlikely I will reach the correct video by querying "again". Because of this, I can add additional search terms to reach the correct video.
ytms again crusher-p vocaloid