Simple scripts to stream videos to VLC and CorePlayer

Discussion in 'PowerPC Macs' started by B-G, Dec 14, 2011.

  1. B-G, Dec 14, 2011
    Last edited: Dec 9, 2012

    B-G macrumors regular

    Dec 14, 2011
    Hi! This is my first post here. I'd like to share two very simple scripts I have created to watch videos on an external player. Now, I'm a complete noob with Applescript, so I hope you can help me improve/expand them. Also, I'd like to know how these work in Tiger with older versions of VLC.

    I like to listen to music from youtube while surfing the web. FlashVideoReplacer on Tenfourfox is good for that, but Quicktime, while being a lot better than Flash, still is a bit of a resource hog when compared to VLC. I don't even want to compare it to CorePlayer. So I tried to automate the copy and paste process of the video URL from browser to external player.

    Copy and paste in Script Editor.

    For VLC:

    set myurl to the clipboard as text
    tell application "VLC"
    GetURL myurl
    end tell

    For CorePlayer:

    tell application "CorePlayer" to activate
    tell application "System Events"
    keystroke "u" using command down
    keystroke "v" using command down
    keystroke return
    end tell

    Choose a location on your hard drive and save.

    Now we will create shortcuts for these scripts. Download a cool little app called Spark from here:
    Install and launch Spark. Select file > New Hotkey > Applescript. Click on file and select the script you have just created. Assign a name and a keystroke combo, then click on create. For example I've assigned "alt -" to VLC and "command alt -" to Coreplayer.
    For the scripts to work you have to copy the video url in the clipboard. Be careful! On youtube (and only on youtube) VLC will accept the link to the video webpage. Elsewhere you will need the link to the actual video file. Coreplayer accepts only links to video files and will freeze otherwise (not a big deal, just force quit). FlashVideoReplacer and DownloadHelper really come in handy here, especially when dealing with embedded videos. So on youtube (and for VLC) it comes to a simple sequence of "command l" "command c" "alt -" "command p". Do it again with other videos and you'll see how easy it is to create a playlist (so you can keep track of what you have watched/listened to). On other sites and with Coreplayer it's not so fast, but still very simple (with CorePlayer you also don't get playlists, but it still is the best if you want to watch HD clips).
    The cool thing is that in both players, if you only want to listen to music, you can go to the preferences and disable the video output. This saves a lot of strain on the CPU. In VLC click on "enable video" in the video pane. In Coreplayer select "disable" for the video output.
    While playing this clip (on my 1.25 GHz 1GB ram eMac)
    I get the following (on average) results from MenuMeters:

    FlashVideoReplacer (quicktime): ~ 85% CPU usage
    VLC (video enabled): ~ 50% CPU usage
    CorePlayer (video enabled): ~ 35% CPU usage
    VLC (video disabled): ~ 18% CPU usage
    CorePlayer (video disabled): ~ 14% CPU usage
    Flash (aah aah, king of the impossible!): ~ 95% CPU usage (I was actually expecting more, this must be Tenfourfox doing its magic).

    I hope you'll find this useful.
  2. Imixmuan macrumors 6502

    Dec 18, 2010
    works with Tiger

    can confirm scripts work with Tiger and VLC 0.9.10. Had to select the file and press play for it to actually play in VLC however. In Coreplayer could play 720p mp4 file on ibook G4 1.2 ghz. Used Flashvideoreplacer and tested in youtube.

    Awesome, thanks for doing this, saves a couple steps.
  3. B-G thread starter macrumors regular

    Dec 14, 2011
    Press "command p" to start VLC from the keyboard ;) (it works for 1.1.12 , but I don't know for 0.9.10)
  4. B-G, Dec 16, 2011
    Last edited: Dec 16, 2011

    B-G thread starter macrumors regular

    Dec 14, 2011
    I've done some testing and I've found that CorePlayer stutters when you disable video output on a streaming mp4 file. Not a big problem, just use links to flv files.

    I was trying to find a way to obtain links to flv files without using FlashVideoReplacer and DownloadHelper. This could be useful if you use a different browser than Tenfourfox/Firefox. Do you know any extension or plugin that would do that under Safari, Camino, Omniweb or Opera?
    A partial solution could be using , which according to seems to be risk free (but the fact it opens java still leaves me a bit worried).
  5. B-G, Dec 20, 2011
    Last edited: Mar 3, 2012

    B-G thread starter macrumors regular

    Dec 14, 2011
    Since VLC is so Youtube friendly, I modified the first script so that I could open a Youtube video with a single keystroke.
    Warning! Reliability may vary with system and browser used. If script doesn't work, try to increase the delays (1 second should solve issues, but it will make everything a bit too slow).

    -- Youtube in VLC
    delay 0.5
    tell application "System Events"
    keystroke "l" using command down
    delay 0.5
    keystroke "c" using command down
    end tell
    delay 0.5
    set myurl to the clipboard
    -- In the next line replace "&fmt=18" with "&fmt=5" to load 240p instead of 360p
    set myurl to myurl & "&fmt=18"
    tell application "VLC"
    GetURL myurl
    end tell

    It works both in Safari and in TenFourFox (and in every other browser where command-L selects the URL bar). The script also adds the code "&fmt=18" to the video URL, to avoid opening a HD clip on a slow computer. If even 360p is too much for your Mac, replace "&fmt=18" with "&fmt=5" to load 240p videos (warning: in my experience VLC doesn't always work flawlessly with flv files; it's not common but I've seen it happen).

    I decided to have some fun trying out different apps. It turns out that RealPlayer Downloader (which of course comes with RealPlayer) is a good alternative to DownloadHelper. It is more limited (no links, you can only download), but it's not tied to a specific browser. It seems to work on the same sites as DownloadHelper.
    I also found a possible way to get URLs to mp4 files using Safari5 + ClickToPlugin. Set ClickToPlugin to open videos in Quicktime (this also allows fullscreen replay, by default disabled in ClickToPlugin for older machines). When Quicktime comes up use command-I to open the movie inspector. Under "source" you will see the URL to the video (*). This may come in handy when trying to open HD clips with Coreplayer, since you can now avoid to start and stop the video in flash player to allow DownloadHelper to perform its magic (something that can really put a lot of strain on my old eMac). The downside is that to watch a single video you are now launching three apps: Safari, Quicktime and CorePlayer. So at the end of the day it could be more simple to just download the clip with cliktoplugin. I tried to automate part of the process, without success. This is the script I came up with:

    [EDIT: this script is not needed, since ClickToPlugin source selector items are right-clickable. See: ]

    tell application "QuickTime Player"
    tell front document to set the clipboard to path as text
    end tell
    tell application "CorePlayer" to activate
    tell application "System Events"
    keystroke "u" using command down
    keystroke "v" using command down
    keystroke return
    end tell

    CorePlayer comes up but nothing happens. Any help?

    (*) NB: this works everywhere, except on Vimeo.
  6. Imixmuan, Dec 20, 2011
    Last edited: Dec 20, 2011

    Imixmuan macrumors 6502

    Dec 18, 2010

    Seems like I'm the only one responding to this thread but I just wanted to say I am grateful for you putting forth the effort to find new and exciting ways to stream video to our aging (gracefully) old PPC macs. Sorry I can't be of more help, other than to say as far as I know there are no plugins for Opera or Camino, its a Safari and Tenfourfox world for us on PPC right now as far as plugins go at least.

    The holy grail of this here situation would be a flashvideoreplacer like extension that actually works natively on the mac, and had some options for lower quality streams for slower G4s and even G3's. On linux (clearly the developers native tongue) it works a charm, loads gnome mplayer and off you stream. On the mac the best thing it does is allow you the see url, as you are exploiting nicely.

    Cameron Kaiser also has his T4Fx Quicktime enabler, which is promising, if you aren't familiar with it you should have a look, its a simple firefox extension that hands youtube and some other video off to quicktime. On youtube it doesn't always see the file (particularly if there are ads or its a vevo music video) and its far from perfect. Kaiser recently posted asking anyone who had some free time to try and port Lightspark or Gnash to PPC OS X. Sounds like a pretty daunting task, as Lightspark doesn't even work with PPC linux right now.

    Gonna try your new script here in a minute, I'll give you any feedback I have.
  7. B-G thread starter macrumors regular

    Dec 14, 2011
    Thanks for the feedback and the encouragement.
    I really hope they are successful in porting Lightspark to Mac PPC. Having a substitute for Flash would really simplify life for us.
    I will experiment a bit with Quicktime enabler.

    There seems to be some problem with the first script in my last post, the one opening Youtube clips in VLC. It doesn't always copy the URL in the clipboard. The problem may be in Spark more than in the script itself. Depending on the keystroke combo you select, if you are not lightning fast at releasing the keys you will create a conflict in the script execution. This is because we are telling System Events to emulate the command-L command-C shortcuts. For example if in spark you select "alt -" to launch the script and you try it in Safari, you will likely see the download window coming up (which is opened by the command-alt-L shortcut). I'm trying to compensate by adding delays, but I'm not having much success. In my eMac the simple solution was setting F16 to launch the script, but it may not be so easy on a laptop. I will edit my previous post if I find a workaround.
  8. B-G thread starter macrumors regular

    Dec 14, 2011
    Fixed the Youtube in VLC script. It should now be more reliable.
  9. B-G thread starter macrumors regular

    Dec 14, 2011
    I did further testing. Regarding the Youtube in VLC script, reliability seems to be tied to the speed of your system and to the browser you are using. I've been a bit conservative with the delays, but if the script doesn't behave properly change the values until you find what works for you.

    I've played a bit with Quicktime Enabler. Considering it's an alpha it works smoothly. Let's hope the guys at Floodgap can extend the number of sites it supports.

    I finally decided to give Greasemonkey/Greasekit a try. I really should have done it before, since I found a couple of extremely useful scripts that work on a good number of sites.
    ViewTube ( and Free Youtube ( play videos using the Quicktime plugin. The download links they provide can also be copied into an external player. Of course, this is excellent to stream clips to Coreplayer (the exception is once again Vimeo, but you can always download). Free Youtube is also good at providing links to the original webpage for embedded clips.
    TenFourFox users should be careful when opening videos with the Quicktime plugin. In my experience for the first few seconds CPU usage seem to be high, and I've seen the occasional spinning beachball of anguish. This is similar to what happens with FlashVideoReplacer when you don't open the video in a separate window, so I guess the culprit may be the Quicktime plugin. Using an external player really seems to work better, at least on my system.
    The great thing is that thanks to Greasekit these script work in any Webkit based browser. I did try with Omniweb and iCab, and all went fine. I found an exception though, and that is Stainless (a browser I find very attractive for its small footprint), perhaps because of its multiple-session features.
    Can someone confirm it all works in Safari 4 on Tiger?
  10. Imixmuan macrumors 6502

    Dec 18, 2010
    Now that's....


    I have never heard of Greasekit. For some reason I thought Greasemonkey and scripts were Firefox only. No excuses, nice to learn something new, what keeps me coming back to macrumors!

    It plays well on Safari 4 and Tiger, 1.2 ghz G4 ibook, 32mb vram. Very, very, very well. No full screen option but its so clean, no lag and easy to use....might be my new preferred method for youtube. Ok, mactubes is hard to beat but this is great. Crazy, the world says PowerPC is dead, but things like this make my day.

    I was gonna post about your scripts, sometimes they worked, sometimes they didn't (new one), but seems like you sorted it out.
  11. Imixmuan macrumors 6502

    Dec 18, 2010
    a minor annoyance

    ...with this greasekit method and viewtube, quicktime sometimes will resize (down, occasionally to near postage stamp size) the embedded video based on I suppose the original resolution. Then, all following videos are reduced to that same size. Restarting Safari (or Omniweb) will correct that, until the next reduced in size video comes along. There doesn't seem to be any way to force quicktime to always use the large size, and yes I google'd it and the oracle wasn't much help.

    B-G, any ideas?
  12. B-G thread starter macrumors regular

    Dec 14, 2011
    I had not noticed that. That's because I tend to open videos in VLC and Coreplayer anyway. I will try to find a solution.
  13. B-G thread starter macrumors regular

    Dec 14, 2011
    I did some tests on Youtube.
    In Safari 5, when using only ViewTube and disabling Free Youtube, mp4 and webm videos get resized properly. Quicktime plugin refuses to play 240p flv files. When using only Free Youtube videos get resized, but if the original resolution is too high they get cut at the sides, and accessing the controls is problematic. The same happen when using both scripts at the same time, since Free Youtube seems to prevail over ViewTube. In terms of cpu usage Safari displays the same behaviour I had noticed on Tenfourfox.
    In Tenfourfox, with only ViewTube enabled, videos get resized properly. Quicktime plugin doesn't play webm and flv files. Free Youtube doesn't seem to work at all on Youtube.
    In Omniweb ViewTube correctly resizes videos, unless you try to open a 720p or 1080p clip. In that case you can only see a part of the video. Since opening HD videos in the browser is a bad idea anyway, that should not be a problem. ViewTube works with all the available formats. With Free Youtube videos are resized properly, but if the original resolution is high sometimes they are not well positioned (they are off center). The same happens when using both scripts at the same time, since once again Free Youtube prevails over ViewTube. Notice that Omniweb behaves really well under the point of view of cpu usage, with no spikes at all.

    I think it is better to enable Free Youtube only when dealing with embedded videos or on the sites ViewTube doesn't support. Since the scripts behaviour varies a lot under different browsers, the best solution seems to be using them only to get links to video files to open them in external players. They behave more predictably and you get all the niceties browsers can't offer (equalizer, playlists, better efficiency, etc.). Please notice that Coreplayer doesn't open webm files though.


    Oh, and thanks for the feedback, Imixmuan. I really appreciate that. :)
  14. B-G, Jan 3, 2012
    Last edited: Jan 4, 2012

    B-G thread starter macrumors regular

    Dec 14, 2011
    I edited the Youtube in VLC script again. Delays have been reduced again to 0.5s (with a warning to modify them if reliability is an issue) since on my systems this makes everything more snappy without negative consequences. I also added a comment about how to load 240p videos (instead of 360p). This can be useful or even necessary on older systems.

    I have not been able to replicate in Leopard the problems Imixmuan has had with ViewTube. I noticed the script is updated quite often on I hope this may be a possible solution. For Youtube there is a very good way to use the Quicktime plugin, though. Take a look at the comments of this post on Tenfourfox development blog:
    Johnson posted a bookmarklet that replaces Flash with QT plugin. It has been working flawlessly on my eMac. It's simple, fast and doesn't generate spikes on cpu usage. This guy deserves credit for the good work done.

    This is not the only bookmarklet I've been playing with. They can be a very quick way to use download sites. Here are several examples:
    KeepVid (
    Nab It! (!.aspx)
    PwnYouTube (
    Download Youtube Etc (
    Videobookmarklet (
    You can probably find a ton more on the net. Results vary with browser used and video watched, but between the five of them I've had good results on a good number of sites. The nice thing is this is not a browser specific solution (good news if you want to have fun with Stainless).

    One last thing. Take a look at the Firefox extensions on this page:
    You may want to try UnPlug. It scans the page for videos, then you can open them in another tab/window, copy the links or download. You don't have to use the "start - stop" method you need with DownloadHelper, so no system slowdowns with HD clips. On Vimeo, though, if you want to use external players you need to open the video on a new tab and only then copy the url from the address bar. This is also true for bookmarklets (with the exception of KeepVid, which gives you the true clip url). Another cool thing about UnPlug is that it seems to work with embedded videos too.

    PS: Two things about bookmarklets. KeepVid and Nab It! use java. PwnYouTube and Download Youtube Etc seem to be the same thing, but sometimes I've seen them working in different ways with the same video.
  15. sebaro macrumors newbie

    Jan 8, 2012

    I'm ViewTube's author.
    I don't have a Mac, I'm using Linux and sometimes I can get a Windows XP box. On Windows I get the same issues with QuickTime and WMP plugins when playing HD videos, because the Object element don't have an absolute size. I've modified the script so the Object element have a size in pixels not in percentage like before. If someone could test this for me in Mac's browsers would be great. Here's the script:

    There's also NinjaKit add-on like GreaseKit:
    I've tested it in Safari 5 for Windows and it worked fine.

  16. B-G, Jan 8, 2012
    Last edited: Jan 8, 2012

    B-G thread starter macrumors regular

    Dec 14, 2011
    Sebaro, thanks for the time and effort you are putting in ViewTube. I really appreciate the help you are giving us.
    I tested the new version of the script in TenFourFox, Safari 5, and Omniweb under Leopard.
    Resizing works well (but please notice i had no problem with the old version of the script), except on HD clips where you can only see the central part of the video (but my computer is too slow to open a HD video in the browser anyway).
    Script can't load videos on Vimeo, Metacafe, Break, Funnyordie, Facebook, Imdb, Blip.
    In TenFourFox, if I click on the menu to choose video resolution, different options appear side by side instead of one above the other. Sometimes this can make difficult to choose lower resolutions. Menu is working well in Safari and Omniweb.
    CPU usage is high until the video has been completely loaded.
  17. sebaro macrumors newbie

    Jan 8, 2012
    First, thanks B-G for your help.

    This is the new version:
    It's only for testing and for now works only for youtube and dailymotion.

    1. If I'm getting it right, large videos still don't resize?
    2. I hope this version fixes videos menu for TenFourFox.
    3. New feature: toggle html5 on/off. If its 'on', the script embeds an HTML5 Video element instead of an Object element and should be played by the browser html5 video plugin, if it supports the video codec.
    4. CPU usage is higher than before? How about with HTML5 player?

    Thanks again.
  18. B-G thread starter macrumors regular

    Dec 14, 2011
    Menu is ok now.
    If I initially try to play mp4 files the script does not load the video. I have to load a different format first, then everything is fine. With html5 on everything is fine. Unfortunetely trying to play webm files in TenFourFox is painful even at low resolutions (this is not a script problem, the computer is just not powerful enough). Things get a lot better in Webkit based browser, where you can play mp4 natively.
    With html5 off this is what happens:

    LD mp4


    HD mp4 (notice that video controls are not visible)


    As for CPU usage during buffering, it seems to depend on the way the Quicktime plugin interacts with the browser. Omniweb behaves much better then Safari and TenFourFox under this point of view, so I think it is not a script problem.
  19. sebaro macrumors newbie

    Jan 8, 2012

    The latest version:
    Should work for YouTube, Dailymotion, MetaCafe, Vimeo, Break & FunnyOrDie.

    The resize issue:
    It seems that QT plugin window doesn't resize to HTML Object element size and it takes the video size instead. Unfortunately I can't control the video plugin from javascript. Maybe there are some plugin options to control the video size, aspect ratio etc.

    Playing mp4 after load issue:
    You mean that, after the video page has loaded, if you click the play button, the video doesn't play? For all sites in all browsers? How about if you turn HTML5 on and then click 'Play'? Please try with the latest version. For me is working fine in Opera, Firefox and Konqueror.

    Can you tell me what greasemonkey add-ons you use for each browser? Does GreaseKit work for Safari 5?

  20. zen.state macrumors 68020


    Mar 13, 2005
    This seems like a lot of hassle to continue as a slave to the horrible web interface of YT. It's a lot easier and more free to just use an app like MacTubes which lets you watch and/or download the vids in their raw h.264.

    Why jump through all these hoops to be a slave to something when there are hassle free alternatives? Make the tech work for you and not the other way around.
  21. Goftrey macrumors 68000


    May 20, 2011
    Wales, UK
    Yes MacTubes is extremely easy to navigate around but for people who have channels and/or want to check subscriptions or use inbox etc. this is a great workaround.

    Thanks B-G!
  22. B-G thread starter macrumors regular

    Dec 14, 2011
    I have a big problem here. My eMac is refusing to power on, so at the moment I have no access to a PPC mac.
    I will try the new script in my MBP, to see if it works well under Lion, but this will not be of any help to PPC users. Let me install and configure Firefox, so that I can have access to Greasemonkey, then I will post the results. This may take a while though.

    As for MacTubes, I like that app so much that I use it even on my intel mac. I think it's important to have alternatives though. Besides, Mactubes only works for YT.
  23. B-G thread starter macrumors regular

    Dec 14, 2011
    That's exactly what happens. I load the video page, I click play and nothing happens. If I try to load a different format then the script works again (even with mp4). This happens for all sites (YT and dailymotion) and browsers.
    I use only ViewTube on TenFourFox/Greasemonkey. On Webkit browsers (Safari 5.0.6 and Omniweb) I have also installed Free Youtube, but it is disabled.
    Greasekit works on Safari 5.0.6, the last version for PPC. If I remember correctly Safari 5.1 is not compatible with Greasekit or other Webkit plugins. I'm gonna install Ninjakit and try your script now.
  24. B-G thread starter macrumors regular

    Dec 14, 2011
    Ok, I have some bad news and some good news.

    Script tested in Safari 5.1.2 (ninjakit), Firefox and SRW Iron under OS X 10.7 Lion.
    Resizing issues are still there for all browsers.
    Safari performs remarkably well on every supported site (with and without html5) with the exception of Vimeo. Something strange happens there. ViewTube bar appears over the video window, then it immediately disappears and flash player is loaded.
    Firefox performs very poorly with html5 off. Video takes a really long time to load, especially at high definition. Since Quicktime logo doesn't appear during loading users may think script isn't working and leave the page. I think this is what actually happened when I tested the script yesterday. This happens on all sites, but metacafe, break and funnyordie perform a little better. If I reload the page video starts for a brief instant before everything is reloaded. With html5 on the script works well on youtube, the only site offering WebM videos. However WebM clips stutter even on this mid-2009 MBP. It seems it is a Firefox thing, since Chromium derived Iron showed a more benign behavior.
    Iron as a matter of fact displays the same problems as Firefox, but performs a little better, with faster loading times (still much slower than safari, though). And the quicktime logo at least shows up while videos are loading. Unfortunately HD clips still take too much time. On Vimeo the video window seems to be shifted to the right.

    Good news is these problems may not be caused by the script. I installed FlashVideoReplacer on Firefox and it performed exactly in the same way. So I think the problem is in Quicktime plugin.
  25. sebaro macrumors newbie

    Jan 8, 2012
    I've made some changes to the vimeo part. I don't know if it works. I don't have flash installed to see if it loads above the script's video window.
    The newest version is here:
    There is nothing else I can do about QT plugin's loading and video size.
    Thanks for testing it for me!

Share This Page

66 December 14, 2011