Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ytb2mp3/ytb2mp3
Convert YouTube videos to mp3 files via the command-line
https://github.com/ytb2mp3/ytb2mp3
Last synced: 4 days ago
JSON representation
Convert YouTube videos to mp3 files via the command-line
- Host: GitHub
- URL: https://github.com/ytb2mp3/ytb2mp3
- Owner: ytb2mp3
- License: mit
- Created: 2017-11-20T12:50:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T00:55:09.000Z (over 1 year ago)
- Last Synced: 2024-10-02T06:49:56.433Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ytb2mp3
A command-line client for extracting mp3s from YouTube videos
## Installation
### Prerequisites
You need a working installation of [ffmpeg](https://www.ffmpeg.org/) on your system. If you're on a Mac, you can use HomeBrew to install it like this:
```bash
$ brew install ffmpeg
```### npm
`ytb2mp3` can be installed via npm:
```bash
$ npm install ytb2mp3 -g
```## Configuration
### Configuration options
`ytb2mp3` can be configured by passing command-line flags. The following flags are available:
```bash
--set-output-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 The quality of the YouTube videos that should be requested (default: highesst)
--set-ffmpeg-path The absolute path to the ffmpeg binary (default: /usr/local/bin/ffmpeg)
--set-progress-timeout 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
```bash
$ ytb2mp3 https://www.youtube.com/watch?v=Vhd6Kc4TZls
```This will yield in the following output:
```bash
Downloading [██████████████████████████░░░░░░░░░░░░░░] 65% | ETA: 3s | Runtime: 4s | Speed: 1518.28 kbytes/sec
```After the finished download, it will point to the output file:
```bash
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:
```bash
$ 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
```bash
$ pbpaste | ytb2mp3
```to directly download the video's audio.