Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Get direct URLs to YouTube videos.

Build status

yturl gets direct media URLs to YouTube media, allowing you to play them in your favourite media player, download them, or do whatever you like.


To get the media URL for a video, pass a URL containing the video ID:


You can get higher quality by using -q high.

It's up to you what you do with the URL. I usually view the video in mpv:

mpv "$(yturl"

You might use a shell function if you do this often:

yt() { mpv "$(yturl "$@")"; }

You can replace mpv with your media player of choice.

Something went wrong with that request. Please try again.