Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Gets direct media URLs to YouTube media, freeing you having to view them in your browser.
Python

README.md

Linux build status Windows build status Coverage Code health Dependencies

yturl gets direct media URLs to YouTube media, freeing you having to view them in your browser.

Usage

Command line

By default, yturl prints the media URL to standard output.

$ yturl 'http://www.youtube.com/watch?v=8TCxE0bWQeQ'
Using itag 43.
http://r2---sn-uphxqvujvh-30al.googlevideo.com/videoplayback?source=[...]

This means that you can do something like the following to watch it in mpv:

$ mpv "$(yturl 'http://www.youtube.com/watch?v=8TCxE0bWQeQ')"

Or something like the following to download it (using curl):

$ curl -Lo bill "$(yturl 'http://www.youtube.com/watch?v=8TCxE0bWQeQ')"

There is also a -q option for controlling the quality, see the program help for more information.

Library

>>> video_id = yturl.video_id_from_url('http://www.youtube.com/watch?v=8TCxE0bWQeQ&hl=en-US#x')
>>> video_id
'8TCxE0bWQeQ'
>>>
>>> for itag, url in yturl.itags_for_video(video_id):
...     print('Itag %d: %s[...]' % (itag, url[:65]))
...
Itag 43: http://r20---sn-aigllnl6.googlevideo.com/videoplayback?key=yt5&up[...]
Itag 18: http://r20---sn-aigllnl6.googlevideo.com/videoplayback?key=yt5&up[...]
Itag 5: http://r20---sn-aigllnl6.googlevideo.com/videoplayback?key=yt5&up[...]
Itag 36: http://r20---sn-aigllnl6.googlevideo.com/videoplayback?key=yt5&up[...]
Itag 17: http://r20---sn-aigllnl6.googlevideo.com/videoplayback?key=yt5&up[...]

Stable

$ pip install yturl

Master

$ git clone git://github.com/cdown/yturl.git
$ cd yturl
$ python setup.py install

Testing

$ pip install -r tests/requirements.txt
$ nosetests

License

yturl is licensed under an ISC license. Full information is in LICENSE.md.

Something went wrong with that request. Please try again.