Git Product home page Git Product logo

ytb2mp3

A command-line client for extracting mp3s from YouTube videos

Installation

Prerequisites

You need a working installation of ffmpeg on your system. If you're on a Mac, you can use HomeBrew to install it like this:

$ brew install ffmpeg

npm

ytb2mp3 can be installed via npm:

$ npm install ytb2mp3 -g

Configuration

Configuration options

ytb2mp3 can be configured by passing command-line flags. The following flags are available:

--set-output-path <path>                The absolute path where the downloaded files should be stored (default: /tmp)
                                        The directory is automatically created if it doesn't exist
--set-video-quality <quality>           The quality of the YouTube videos that should be requested (default: highesst)
--set-ffmpeg-path <path>                The absolute path to the ffmpeg binary (default: /usr/local/bin/ffmpeg)
--set-progress-timeout <milliseconds>   The time in milliseconds in which the download progress should be refreshed
                                        (default: 200ms)

This information is also displayed when ytb2mp3 is called with the --help flag.

The configuration options will be persisted in ~/.config/configstore/ytb2mp3.json.

Usage

Download a video's audio as mp3

$ ytb2mp3 https://www.youtube.com/watch?v=Vhd6Kc4TZls

This will yield in the following output:

Downloading [██████████████████████████░░░░░░░░░░░░░░] 65% | ETA: 3s | Runtime: 4s | Speed: 1518.28 kbytes/sec

After the finished download, it will point to the output file:

Song was downloaded: /Users/username/yt2mp3/Cold Funk - Funkorama.mp3

Specifying a filename

You can use the --name "filename.extension" flag to specify a name for the output file:

$ ytb2mp3 --name "Cold Funk - Funkorama.mp3" https://www.youtube.com/watch?v=Vhd6Kc4TZls

This is useful if the algorithm of youtube-mp3-downloader cannot automatically determine a decent filename from the video's metadata.

Pasting a copied URL from the clipboard (MacOS)

Copy a video URL from your browser. Then, you can use the command

$ pbpaste | ytb2mp3

to directly download the video's audio.

ytb2mp3's Projects

ytb2mp3 icon ytb2mp3

Convert YouTube videos to mp3 files via the command-line

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.