aboutsummaryrefslogtreecommitdiff
> watch [/c <argument-string>] <video/playlist-url>

This program takes a YouTube video/playlist URL as an argument and opens the video/playlist in MPC-HC. The videos are streamed, not downloaded and then played. There are downloadable builds of MPC-HC with built-in support for YouTube streaming, but these unfortunately do not support Windows XP. My program works on any operating system that can run youtube-dl.

The benefits of playing YouTube videos in a real media player are many. If you have a non-widescreen monitor, you can zoom in to remove black bars (in MPC-HC, View > Video Frame > Touch Window From Outside). You can fix potential audio-video sync issues in the video. Most importantly, you don't have to waste as much memory on displaying YouTube's video page. (To get an idea of how much memory YouTube uses, see this comparison between YouTube and invidio.us, an alternative YouTube front end.)

The program can be started from the command prompt or the Run... window. I recommend putting it somewhere in your PATH. Then, you can easily watch videos by copying the URL, opening a Run... window with Win-R and issuing watch <url>. A command prompt will be visible as the program retrieves the addresses for the audio and video streams, but will be closed once MPC-HC is launched.

If you supply an argument-string using the /c option, it will be copied verbatim directly to the youtube-dl command line, letting you specify extra parameters for the process (for example, /c "-f best").

If you want to interrupt the retrieval process (e.g., if there are a hundred videos in the playlist and you just want to stream the first five), press Ctrl-Break. This will open MPC-HC with the videos that have been retrieved so far. If you want to interrupt the process without launching MPC-HC, press Ctrl-C.

Dependencies: youtube-dl, MPC-HC, the first of which must be placed somewhere in your PATH. Note that youtube-dl needs to be updated regularly; if the script stops working, then issue youtube-dl -U from a command prompt.

Bookmarklet

To make a bookmarklet that opens a YouTube video from your browser in MPC-HC, you need to download the files watch.exe, watch.reg and watch.js from the repository.

  1. Install watch.exe as C:\watch.exe.

  2. Register the watch: protocol handler in the registry by downloading and running watch.reg.

  3. Copy the contents of watch.js to a bookmark in your web browser. It supports the following features:

    1. Single-click the bookmark to convert all links on the page to watch: links.
    2. Single-click it again to revert the links. (This also happens automatically when you click a link.)
    3. Double-click the bookmark to open the current page as a watch: link.