You are not logged in.
ytcmd is a tool to execute shell commands on YouTube videos. It is written in Python 3.3, and is available under the MIT license. (GitHub page)
$ ytcmd SvaG0xDdP8g
Title: The Space Shuttle (Narrated by William Shatner)
Length: 1:20:44
ID: SvaG0xDdP8g
45 720p webm
22 720p mp4
35 480p flv
43 360p webm
34 360p flv
* 18 360p mp4
5 240p flv
36 240p 3gp
17 144p 3gp
Get the video URL (for the format marked with “*”):
$ ytcmd -u SvaG0xDdP8g
http://r6---sn-po8puxa-c0ql.c.youtube.com/ ...
Play with mplayer:
$ ytcmd --exec 'mplayer "$url"' SvaG0xDdP8g
Same, but fake the User-Agent, display the title in the titlebar, and allow seeking to a given time:
$ yt.play() { ytcmd -e 'exec mplayer -user-agent "$ua" -title "$title" ${ss:+-ss "$ss"} "$url"' "$@"; }
$ ss=15:00 yt.play SvaG0xDdP8g
Play in HD, but only WebM or MPEG-4 formats:
$ yt.play SvaG0xDdP8g 1080:720p/webm,mp4
Last edited by ma (2013-03-15 09:55:51)
Offline
it's good but it would have been better had you written a script on top of youtube-dl rather than re-inventing the wheel
Offline
it's good but it would have been better had you written a script on top of youtube-dl rather than re-inventing the wheel
Re-inventing the wheel is a good way to learn. Of course, if this was purely for practical purposes then I agree.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline