DEV Community

Cover image for Download videos and music from youtube via command line: youtube-dl
Israel-Lopes
Israel-Lopes

Posted on • Edited on

2

Download videos and music from youtube via command line: youtube-dl

To download music and videos from youtube via command line is very simple.

First we have to install youtube-dl

sudo apt install youtube-dl

If you want to listen to music directly through the terminal, you can also install mplayer or mvp.

Once installed, just do:

youtube-dl -x --audio-format mp3 <URL_VIDEO>

To listen to it, you can use mplayer <file_name>

If you want to change the audio directly through the terminal, you can use this macro I made, just add it to your zsh file

# Muted sound on/off
alias sound_off="amixer -D pulse sset Master mute"
alias sound_on="amixer -D pulse sset Master unmute"

Enter fullscreen mode Exit fullscreen mode

Outras macros:

increase

amixer -D pulse sset Master 20%+

decreases

amixer -D pulse sset Master 20%-

If you prefer, you can use alsamixer directly as well, as it comes with a text interface.

machine@machine~: alsamixer

If it is necessary to configure the sound card, just press f6 and select it.

Image description

after select

Image description

Texto alternativo da imagem

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay