Filed in: UserExperiences.PlayingYoutubeVideosOnGNewSense · Modified on : Mon, 01 Mar 10
This page is no longer up to date, there are other ways now of doing this. Ytplay is no longer maintained.
=================================
It will come as quite a surprise to many people that it is possible to play Youtube.com videos on gNewSense GNU/Linux. It is a testimony to Free Software developers that this is possible at all.
The Free Software programme ffmeg can play flv video files which are streamed by Youtube using proprietary Adobe Flash software. I got his information from a comment by Alan Pope (popey) on the Freenode #gnewsense IRC channel. It set me to wondering how this could be utilized on gNewSense.
I've ended up putting together a BASH script to download and play or save the flv video files. I've also put in an option to convert the video to Theora which is a much more friendly format.
This is a quite crude BASH script and I am certain that when more experienced scripters look at it they will see all sorts of ways to improve it. However, it does work, and I am personally using it when people direct me towards videos on Youtube.com.
Of course, I still mention to them that hosting videos on a website that depends upon proprietary formats is not really a good idea.
This is now version 0.2-1 of this script.
Updated 05/02/2008 for changes on Youtube.com pages.
I updated the original script with some security features to prevent the possibility of a local attack using symlinks.
Matthew Flaschen then added a neat way to watch embedded Youtube videos and also amended the save routine to save output files relative to the directory the script was started in.
Installation.
There's not really much installation needed.
First, you need to make sure that you have the ffmeg and ffmpeg2theora packages installed:
sudo apt-get install ffmpeg ffmpeg2theora
Then all you need to do is to copy the file "ytplay" onto your computer and make it executable.
Personally, I copied the file into my /usr/local/bin directory, so that it can be invoked from any directory. Use the command:
sudo cp ytplay /usr/local/bin
then make it executable:
sudo chmod 755 /usr/local/bin/ytplay
Now you can use the ytplay command where ever you are in Terminal.
It is very simple to use this script.
To play a Youtube video, go to the page where the video is on Youtube.com and copy it's URL.
ytplay http://www.youtube.com/watch?code_from_youtube
To replay a video that you have just played, use:
ytplay replay
to save the Youtube video to your desktop, use the following
ytplay http://www.youtube.com/watch?code_from_youtube -o file_type file_name
File type is either flv or theora. File name is what you would like to call the downloaded file. You do not need to add the .flv or .ogg extentions as these will be added automatically.
Unfortunately, the Youtube web pages may change their format at any time meaning that this script will have to be adapted.
Also published published at:
http://www.andrew-wigglesworth.co.uk/computers_and_software/howto/ytplay.php
There's a script to download videos on several internet pages. It can be downloaded via subversion. (If it isn't installed apt-get install subversion).
svn co svn://svn.sv.gnu.org/urip/WatchVideo
It will be on your working directory. So now you can use it like this
./WatchVideo -d VideoLink
gNewSense is a project developed by volunteers all over the world and it's supported by the Free Software Foundation.
The content in this Web site can be used as follows:
All documentation is available under the terms of the GFDL with no invariant sections. ( note on the license )
Artwork is Free Cultural Work and is available under the terms of the cc-by-sa license.