All Projects → sorashi → youtube-play

sorashi / youtube-play

Licence: MIT license
🎵 A command-line utility which streams music from YouTube

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to youtube-play

Live Dl
Download live streams from YouTube
Stars: ✭ 82 (+74.47%)
Mutual labels:  ffmpeg, youtube-dl
Candy
🍭 Cross-platform YouTube-downloader with playlist and channel support as well as build-in audio / video converter.
Stars: ✭ 229 (+387.23%)
Mutual labels:  ffmpeg, youtube-dl
Ytmdl
A simple app to get songs from YouTube in mp3 format with artist name, album name etc from sources like iTunes, Spotify, LastFM, Deezer, Gaana etc.
Stars: ✭ 2,070 (+4304.26%)
Mutual labels:  ffmpeg, youtube-dl
Ydls
youtube-dl HTTP download and transcode service
Stars: ✭ 68 (+44.68%)
Mutual labels:  ffmpeg, youtube-dl
Homebridge Camera Ffmpeg
Homebridge Plugin Providing FFmpeg-based Camera Support
Stars: ✭ 726 (+1444.68%)
Mutual labels:  stream, ffmpeg
Fast Youtube To Mp3 Converter Api
Very Fast YouTube to MP3 & MP4 Converter API
Stars: ✭ 69 (+46.81%)
Mutual labels:  ffmpeg, youtube-dl
Video Downloader Deploy
Video Downloaders (you-get, youtube-dl, annie) One-Click Deployment Batch. || 视频下载器 (you-get, youtube-dl, annie) 一键配置脚本。
Stars: ✭ 178 (+278.72%)
Mutual labels:  ffmpeg, youtube-dl
Mpv.net
🎞 mpv.net is a modern media player for Windows that works just like mpv.
Stars: ✭ 737 (+1468.09%)
Mutual labels:  ffmpeg, youtube-dl
Huong-dan-cai-dat-stream-server-va-chuyen-doi-video-sang-streaming
Hướng dẫn cài đặt stream server và chuyển đổi video thường sang dạng TS Streaming
Stars: ✭ 29 (-38.3%)
Mutual labels:  stream, ffmpeg
discord-ytdl-core
Simple ytdl wrapper for discord bots with custom ffmpeg args support.
Stars: ✭ 52 (+10.64%)
Mutual labels:  stream, ffmpeg
Gui-Youtube-dl
A cross platform GUI for youtube-dl written entirely in python using the WX library.
Stars: ✭ 60 (+27.66%)
Mutual labels:  ffmpeg, youtube-dl
live-stream-media-source-extensions
Live stream h264 encoded mp4 video on media source extensions using ffmpeg, node.js, socket.io, and express. Works in chrome, firefox, safari, and android. Not iOS compatible. Work has moved to mse-live-player repo =>
Stars: ✭ 24 (-48.94%)
Mutual labels:  stream, ffmpeg
Crunchyroll Downloader
A little GUI to download crap from crunchyroll.
Stars: ✭ 54 (+14.89%)
Mutual labels:  ffmpeg, youtube-dl
Youtube Api
A way to host your own API that converts youtube video's to mp3/mp4 and returns a download/stream link and information.
Stars: ✭ 76 (+61.7%)
Mutual labels:  ffmpeg, youtube-dl
Youtube Fetcher
📺 Youtube Podcasting 🎧
Stars: ✭ 31 (-34.04%)
Mutual labels:  ffmpeg, youtube-dl
Downline
Free cross-platform desktop app to download videos and music from YouTube and many other sites
Stars: ✭ 146 (+210.64%)
Mutual labels:  ffmpeg, youtube-dl
Boram
🎞 Cross-platform graphical WebM converter
Stars: ✭ 312 (+563.83%)
Mutual labels:  ffmpeg, youtube-dl
Axiom
An FFmpeg GUI for Windows
Stars: ✭ 560 (+1091.49%)
Mutual labels:  ffmpeg, youtube-dl
Savify
Download Spotify songs to mp3 with full metadata and cover art!
Stars: ✭ 227 (+382.98%)
Mutual labels:  ffmpeg, youtube-dl
plugin.video.sendtokodi
📺 plays various stream sites on kodi using youtube-dl
Stars: ✭ 86 (+82.98%)
Mutual labels:  stream, youtube-dl

youtube-play

Note: mps-youtube is a much better alternative to this project.

youtube-play is a command-line utility for Windows written in C#, which uses youtube-dl and ffmpeg to stream music from YouTube.

I needed a way to play music from YouTube without having Chrome open with a video playing in the background. That's why youtube-play is very lightweight. A quick analysis with Process Explorer shows 0.00…-0.01… % CPU usage and ~20 MB of RAM usage (including all sub-processes).

Installation

youtube-play needs youtube-dl and ffplay to be in your PATH. The fastest and easiest way to do this is using Chocolatey. To install Chocolatey, open cmd as Administrator, and run the following command:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Then execute the following command, to install youtube-dl and the ffmpeg package. By installing you accept licenses for the packages.

choco install youtube-dl ffmpeg -y

Beware: currently, the ffmpeg build from Chocolatey doesn't support the webm format. To avoid this, use an official nightly build

After that, you are ready to download youtube-play. Recent release with binaries can be found here.

Usage

Run youtube-play with any number of arguments, where an argument can be either:

  • link to a YouTube video, playlist or channel
  • -f flag followed by a filename, with a link to a YouTube video, playlist or channel on each line

Examples

  • youtube-play https://www.youtube.com/watch?v=ePX5qgDe9s4
    • plays the video
  • youtube-play https://www.youtube.com/playlist?list=PLZHQObOWTQDMV832OM2s0zRjsgphR5UJR
    • plays the whole playlist
  • youtube-play https://www.youtube.com/playlist?list=PLZHQObOWTQDMV832OM2s0zRjsgphR5UJR https://www.youtube.com/watch?v=lX44CAz-JhU https://www.youtube.com/watch?v=qeMFqkcPYcg
    • plays the whole playlist and another two videos
  • youtube-play ScLcV4feihM _QiSu4yO0Kk
    • plays two videos – note that it's enough to tell the video id
  • youtube-play _QiSu4yO0Kk -f list1.txt ScLcV4feihM -f list2.txt
    • plays one video, then reads the file list1.txt and plays every link on each line of the file, then plays another video and then plays every link in the file list2.txt

Alternatives

mps-youtube is a much better alternative to this project. It has a huge community of developers, is multi-platform and written in Python. Too bad I found out about mps-youtube so late.

You can use foobar2000 with the foo_youtube component to achieve the same. However, it's not a command-line utility, but a whole music player.

Planned features

  • Global keyboard hook which will allow you to pause/stop the playback or skip the current song
  • Random playback – -r flag which will turn random shuffle on for the videos following the flag, repeating the flag will turn the shuffle off for the following links and vice versa
  • Support specifying ranges of videos from playlists to be played (currently the whole playlist is played from start to end)

Contributors

Thanks goes to these wonderful people (emoji key):


Dennis Pražák

💻

pcroland

🐛

Mayank Jha

🚧

Matt

💻 🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

What is happening behind the scenes

It's pretty easy. I'll show you the process of doing the same thing without youtube-play (youtube-play uses a bit different commands that are more understandable for machines).

Prepare a <link> to a YouTube video. Open up your command-line. Execute youtube-dl -F <link>. youtube-dl will respond with a table with available formats for the video. Example:

format code extension resolution note
139 m4a audio only DASH audio 48k , m4a_dash container, mp4a.40.5@ 48k (22050Hz)
249 webm audio only DASH audio 68k , opus @ 50k, 1.40MiB
250 webm audio only DASH audio 86k , opus @ 70k, 1.85MiB
140 m4a audio only DASH audio 128k , m4a_dash container, mp4a.40.2@128k (44100Hz)
251 webm audio only DASH audio 156k , opus @160k, 3.63MiB
171 webm audio only DASH audio 202k , vorbis@128k, 4.42MiB
278 webm 256x144 144p 105k , webm container, vp9, 24fps, video only, 2.59MiB
160 mp4 256x144 DASH video 110k , avc1.4d400c, 24fps, video only
242 webm 426x240 240p 246k , vp9, 24fps, video only, 5.60MiB
133 mp4 426x240 DASH video 285k , avc1.4d4015, 24fps, video only
243 webm 640x360 360p 464k , vp9, 24fps, video only, 10.91MiB
134 mp4 640x360 DASH video 634k , avc1.4d401e, 24fps, video only
244 webm 854x480 480p 856k , vp9, 24fps, video only, 20.38MiB
135 mp4 854x480 DASH video 1254k , avc1.4d401e, 24fps, video only
247 webm 1280x720 720p 1706k , vp9, 24fps, video only, 41.67MiB
136 mp4 1280x720 DASH video 2534k , avc1.4d401f, 24fps, video only
248 webm 1920x1080 1080p 2938k , vp9, 24fps, video only, 74.36MiB
137 mp4 1920x1080 DASH video 4363k , avc1.640028, 24fps, video only
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
43 webm 640x360 medium , vp8.0, vorbis@128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)

Select the format that suits you the most and remember its format code. youtube-play prefers audio only formats with the largest bitrate possible (which you can find in the note column), but you can choose any format with sound, since the video will be omitted.

Next, execute youtube-dl -f <format code> -g <link>. This will respond with a direct link to the file. You can either copy it in the cmd, or pipe it into your clipboard like this:

youtube-dl -f <format code> -g <link> | clip

To stream the sound from the file, execute this command:

ffplay -volume <number from 0 to 100> -nodisp -vn -autoexit "<paste the direct link here>"

ffplay will stream the sound and exit when it's complete.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].