I would like to find an application external to the internet browser that would play only youtube sound.
Preferably a very light one, CLI or GUI.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI would like to find an application external to the internet browser that would play only youtube sound.
Preferably a very light one, CLI or GUI.
There is youtube-dl that lets you download youtube videos from the cli. There is also a new(ish) tool called mps-youtube, that I haven't personally used, but looks like it does exactly what you want.
https://github.com/mps-youtube/mps-youtube
Give it a try and let us know if it works
MPS is available in Ubuntu repos.
Launch the MPS console with
mpsyt
To search youtube in mps console:
/<your_search_term>
After searching a term, and then selecting a number, the stream will play sound; there are play/pause, seek, volume options:
To see options:
mpsyt h
More detailed options:
mpsyt help search
mpsyt help download
After searching and then selecting the number of the stream with a command that would show download options:
d <number>
Playlists can also be searched in the PLS console with
pls <search_term>
or even simpler
//<serch_term>
VLC can do that.
cvlc
to turn off the GUI--vout none
or --no-video
Example:
cvlc --vout none <URL>
cvlc --no-video <URL>
cvlc --vout none
or cvlc --no-video
, and edit name to something like 'VLC Audio'. Then, in the Firefox, right click on a youtube link, 'Open with': VLC Audio. To shut down pkill vlc
. -- But even so the interaction with the playing track is very limited and the results are not as good as with the more specialized MPS.
– user32012
Sep 15 '15 at 12:34
mplayer -novideo
– user32012
Sep 15 '15 at 13:05
You can do this with yturl, for example, using mpv or mplayer:
mpv --no-video "$(yturl <url>)"
mplayer -novideo "$(yturl <url>)"
Disclaimer: I am the author of yturl.
mpv --no-video <url>
? I tested the latter and it starts after a minute or more
– user32012
Sep 15 '15 at 13:28
mpv --no-video "$(yturl -q low <url>)"
.
– Chris Down
Sep 15 '15 at 13:30
In order to select only the audio stream and send it to a player (video players like SMPlayer, VLC, mpv, mplayer, Dragon Player, Totem, but also audio players like Audacious):
It is able search, list and play Youtube videos, and is meant to work with SMPlayer, but can be used separately. It has a setting to add/use different players and also an option to select only audio.
Go to settings
Then select and/or add players to be used, and edit their setting to play also audio (for video players) or only audio, for audio players like Audacious.
They can then be found when right-clicking a title and selecting 'Open audio'.
Can be found as deb and other formats here. It supports more than Youtube (Baidu, Video etc) and has a setting to play only audio:
It can create and save playlists.
It will start after a few seconds, some players after more than others. The fastest seems to be SMPlayer.
To use the 'no-video' arguments with the Firefox addons, the way to do it is like so for Flashgot:
and like so for OpenWith:
More on playing embedded videos in external players, in this superuser question.
Also, an idea is that using certain internet browsers (Seamonkey, Epiphany etc - but not Firefox and Chrome), an Youtube title could be dragged and dropped onto mpv
or a mpv
fron-tend to play Youtube videos.
For the present purpose those players should be started with a 'no video' argument.
Youtube-Viewer
(more here) can be adjusted to play only sound.
For *ubuntu:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-viewer
In spite of what is said at the link above, it works fine with mplayer.
Just like MPS from the other answer, it is meant to search, play and download youtube streams, only that by default it will play the video and not just the audio stream. It can use mplayer as external player.
The command for mplayer without video is
mplayer -novideo
To start Youtube Viewer with this option:
youtube-viewer --video-player=mplayer -novideo
That can be added in a .desktop file with the lines:
[Desktop Entry]
Name=Youtube Audio-only
Exec=bash -c 'youtube-viewer --video-player=mplayer -novideo'
Terminal=true
Type=Application
Icon=youtube-viewer
When started, just type the search and then the number of the track to play.
Closing the terminal will close the play.
(d <number>
will download that video, by default as webm. And, of course, Youtube-Viewer is meant for seeing the youtube video too. For that, just use youtube-viewer --video-player=mplayer
or youtube-viewer --video-player=mpv
.)
You can simply pipe the output of youtube-dl with your preferred format into ffplay.
example:
youtube-dl -f 251 https://www.youtube.com/watch?v=vdRJMuOFO88 -o - | ffplay -nodisp -autoexit -i -
to list available formats use:
youtube-dl -F https://www.youtube.com/watch?v=vdRJMuOFO88
Headset app lets you play only the audio from YouTube. It has built in search functionality where you can search directly into YouTube. It also provides you an option to play songs from particular subreddit. But it opens a small window, which plays the lowest possible quality of video from YouTube.
The application is opensource and available as a .deb file for Ubuntu and also for other platforms like Windows and Mac OS.
Nightly Build on any snapd enabled Linux Distribution can be installed using:
Arch Linux (AUR):
Features
ScreenShots:
You can check out my GitHub repository.
I wrote this script for listening to music on youtube but can be used to listen any audio.
For streaming YouTube audio from the command-line, without messing with API keys,
you can also create .m3u
playlists for playing video in MPV, etc.
AUR Package: https://aur.archlinux.org/packages/yt-bin