Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
39
Help us understand the problem. What is going on with this article?
@yuki_ycino

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

More than 5 years have passed since last update.

使うもの

  • 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/

39
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
39
Help us understand the problem. What is going on with this article?