37
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

コマンドラインからyoutubeを再生する

Last updated at Posted at 2014-08-26

使うもの

  • youtube-dl
  • mplayer (or mpv)

install

https://github.com/rg3/youtube-dl/blob/master/README.md#installation

Mac

Homebrew
$ brew install youtube-dl mplayer

Linux

apt*/yum
$ sudo apt-get install youtube-dl mplayer

Windows

youtube-dl.exe
https://yt-dl.org/latest/youtube-dl.exe

https://github.com/rg3/youtube-dl/releases

mplayer-win
http://oss.netfarm.it/mplayer-win32.php

update

native
$ sudo youtube-dl -U # -U/--update
# or
youtube-dl -U

python-pip

install
$ sudo apt-get install python-pip # if needed
$ sudo pip install youtube-dl
update
$ sudo pip install -U youtube-dl # -U/--update

コマンド

通常再生

$ youtube-dl 'https://www.youtube.com/watch?v=hoge' -o - | mplayer -

音声のみ

$ youtube-dl 'https://www.youtube.com/watch?v=hoge' -o - | mplayer - -novideo

or

fetch-sound-only
$ youtube-dl 'https://www.youtube.com/watch?v=hoge' -f bestaudio -o - | mplayer -

## mpv next mplayer2

install

play

play
$ mpv 'https://www.youtube.com/watch?v=hoge'
sound-only
$ mpv 'https://www.youtube.com/watch?v=hoge' --no-video # or -no-video

http://mpv.io/manual/master/

37
41
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
37
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?