Many people know that the universal VLC media player is able to play video from a site YouTube - enough to load the address of the page with the video menu File> Open Network (File> Open Network). However, this procedure can be reduced to a single click of a mouse, created using the "Avtomatora" elementary service OS X.
The advantages of this method of viewing video yutyubovskogo can call several. First, VLC automatically loads the video in the best quality from the available options - and without ads and pop label links. Secondly, when playing in VLC user at the disposal of all the necessary arsenal "uluchshalok" pictures - including the ability to crop and change the aspect ratio (sometimes necessary). Third, the links to their favorite videos in a playlist can be collected and run them without having to download the YouTube site. You can, of course, remember and function to save streaming video, but it can be set more effective means.
What is the essence of the proposed service "Avtomatora". Causing it, you pass the address of the current page in the VLC playlist, then the player will move to the newly added link and start playback. This simple algorithm is implemented in a single action - AppleScript script (complete the text below):
Note that in the header of the algorithm does not specify the data type. This means that anything not specifically need to allocate before starting the service. In the second drop-down list, please indicate from which program you are going to run this service. The following code allows you to use the Safari browser, Google Chrome, Firefox, or Opera - when the service from other programs loading a web address in VLC is not performed.
Full script code is as follows:
on run {input, parameters} set _URL to GetCurrentURL () if _URL starts with " http://www.youtube.com" then tell application "VLC" OpenURL _URL -> URL loading playlist VLC next -> Player go to you just added point-play playlist -> activate the playback start -> forced withdrawal of the player window to the front end tell end if. end run on GetCurrentApp () -> Definition name tell application "System Events" active applications get short name of the first process whose frontmost is true end tell. end GetCurrentApp on GetCurrentURL () -> Definition of the current Web page addresses set _app to GetCurrentApp () if _app is in { "Safari", "WebKit"} then -> If the call is from Safari using terms from application "Safari" tell application "Safari" get URL of current tab of window 1 end tell end using terms from else if _app is "Chrome" then -> If the call is from Chrome tell application "Google Chrome "get URL of active tab of first window end tell else if _app is" Firefox "then -> If the call is from Firefox tell application" System Events "keystroke" l "using {command down} keystroke" c " using {command down} delay 1.0 get the clipboard as string end tell else if _app is "Opera" then -> If the call is from Opera tell application "Opera" get URL of front document as string end tell end if end GetCurrentURL
Retaining the service, for example, under the name Upload a web address in VLC, Open any YouTube page with the video and through the main browser menu call just saved service. In response to this will be launched VLC (of course, provided that you have it installed) - and will play the video. Recall service will create a playlist in the player a new point and starts playing it.
Housekeeping tip. Do not forget that any item in the main menu of Mac software, you can assign keyboard shortcuts - through the program «System Preferences» (System Preferences), the module Keyboard (Keyboard), tab Shortcut keys (Keyboard Shortcuts)section Keyboard shortcuts for the program (Application Shortcuts). By assigning a keyboard shortcut for an item Upload a web address in VLCCreated the service "Avtomatora" You can call without taking your hands off the keyboard.
Interesting, what and the program will show in the window of information about the current video (key command+I). VLC loads basic information about the video, as well - a nice bonus - the physical address of the video on YouTube's servers. Selecting and copying the contents of the Location, It can be inserted into a download manager - and download the video to your computer.