I have been trying hard for a while to figure out how to create an Applescript application which I could use to successfully stream YouTube urls to mplayer. I have an executable bash script that can do it just fine. It contains just one line -
I named it yt and I have it placed in the /opt/local/bin folder. To use it, I just copy a YouTube video url(e.g. http://www.youtube.com/watch?v=Ok6pI1iD8PU) and then open up a terminal window and type, "yt http://www.youtube.com/watch?v=Ok6pI1iD8PU" The video then plays in mplayer just fine. The reason I want an Applescript to do this is because I want to use it in conjunction with this Firefox addon I have called 'Open with...' Can anyone please help me with this endeavor of mine? Thanks.
Code:
mplayer -loop 0 -really-quiet -geometry 1000x1000 -ontop -cache 8192 $(youtube-dl -g "$1")