About
ViewTube is a JavaScript application for watching videos from video websites with a video plugin, an external video player or the HTML5 video player. A download option is also available. Below are all supported sites. There is an extra script that adds support for more sites.


Sites
The main video sharing web sites on which you can watch videos using ViewTube.



Installation
Installation
Read the following information on how to install the script in different browsers.


Firefox
To work in Firefox based browsers the script has to be installed with one of Greasemonkey, Tampermonkey or Violentmonkey add-ons from Mozilla Add-ons. Or install the ViewTube add-on from Mozilla Add-ons or manually download and install it from here.

Chromium
To work in Chromium based browsers the script has to be downloaded and dragged and dropped in the extensions page or installed with the Tampermonkey or Violentmonkey extension from Chrome Web Store. Or use the ViewTube extension from Chrome Web Store or manually download and install it from here.

Pale Moon
To work in Pale Moon or Basilisk it is required to install the Greasemonkey extension.

Falkon
To work in Falkon (QupZilla) it is required to enable the GreaseMonkey extension.

Opera
To work in Opera the script has to be downloaded and dragged and dropped in the extensions page or installed with extensions, Tampermonkey from Opera Add-ons or Violentmonkey. Or manually download and install the ViewTube extension from here. For versions older than 15 download and save the script in the JavaScript files directory and enable "User JavaScript on HTTPS" in "opera:config" or use the Violentmonkey extension.

Safari
To work in Safari it is required to install the Tampermonkey extension.



Usage
Usage
Read the following information on how to use the script.

Select the video from the menu or use the options window to select the preferred video definition and container.

Play/Stop
Use these buttons to play/stop the video playback. Clicking the video thumbnail will also start the video playback.

Download
Click this button to get the video stream link. If the download doesn't start, click "Link". The browser will show the open popup window. Some browsers don't have this feature and will open/play the video, for these right click 'Link' and 'Save link as'.

DASH
Some sites use DASH streams, which are audio only and video only. These are shown in the videos menu as "Video Only" and "Audio Only". Enable DASH playback support in the options window and the videos menu will show new videos as "Video With Audio". You can play these using the browser player, a plugin or an external player, read below for more details.

HLS
Some sites use HLS streams, which breaks the stream into a sequence of small chunks. These are shown in the videos menu as "HLS". You can play these using a plugin or a browser protocol and an external script, read below for more details.

Widesize
Click these buttons to enter/exit widesize mode.

Fullsize
Click these buttons to enter/exit fullsize mode.

Options
Click the vertical dots to open the options window.

Embed (Video, Object, Embed, Protocol, Tab)
Select which type of embed option to use when playing the videos. Choose "Video" if you want to use the browser video player (HTML5), "Object" or "Embed" if you want to use a plugin (NPAPI, not supported anymore by most browsers), "Protocol" if you want to use an external player or "Tab" if you want to open the video in a new tab/window.

Media (Auto, MP4, VLC etc.)
Select which type of media or plugin to use when embeding the video. Choose "Auto" so the video is embedded using its own media/mime type, choose other option for embedding the video with a different media type or with a plugin.

Definition (SD, HD etc.)
Select the default (highest) video definition.

Container (MP4, WebM etc.)
Select the default video container.

Open Page Link
Enable/disable auto selection of the page link as the default option in the videos menu. This can be used with a plugin or an external application. With this option enabled the video page link is passed to the plugin or the external application which gets and plays the video stream. The plugins that support this are MPV (mozplugger + mpv + youtube-dl) and VLC.

Autoplay
Enable/disable video autoplay. If it's on the video starts to play when the video page is loaded or when a new video format is selected. If it's off a video thumbnail is shown.

Play DASH
Enable/disable DASH streams (video with audio) playback. Available options are "Video", "Embed+VLC" and "Protocol". The default option is "Video". Select "Embed" and "VLC" or "VLC*" in the embed and media menus to use VLC instead. Select "Protocol" in the embed menu to use an external player. This is experimental and it may not work as expected.



Linux
On Linux and BSD platforms the options for video playback are:

1. the browser video player (HTML5)

2. video plugins (NPAPI): VLC, Gecko-mediaplayer, Totem (Gnome Videos), Mozplugger

3. external video player through a protocol

3.1 Create the viewtube script, bash example using mpv or vlc for video playback

viewtube.sh
#! /bin/bash

i="$(echo "$1" | sed -e "s/viewtube://" -e "s/SEPARATOR/|/g")"
v="$(echo "$i" | cut -d "|" -f 1)"
a="$(echo "$i" | cut -d "|" -f 2)"
s="$(echo "$i" | cut -d "|" -f 3)"
if [ "$a" = "" ]; then
   if [ "$s" = "" ]; then
      mpv --osc --fs "$v" || cvlc -f "$v"
   else
      mpv --osc --fs --sub-file="$s" "$v" || cvlc -f --sub-file="$s" "$v"
   fi
else
   if [ "$s" = "" ]; then
      mpv --osc --fs --audio-file="$a" "$v" || cvlc -f --input-slave="$a" "$v"
   else
      mpv --osc --fs --sub-file="$s" --audio-file="$a" "$v" || cvlc -f --sub-file="$s" --input-slave="$a" "$v"
   fi
fi


3.2 Create the viewtube protocol file in ~/.local/share/applications

viewtube.desktop
[Desktop Entry]
Name=ViewTube Protocol
Exec=/path/to/viewtube.sh %u
Type=Application
Terminal=false
MimeType=x-scheme-handler/viewtube


Enable protocol:
xdg-mime default viewtube.desktop x-scheme-handler/viewtube


Test:
xdg-open viewtube:http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4


3.3 Activate the protocol

Click here to associate the script to the protocol

3.4 Select 'Protocol' in the embed menu from the options window


Windows
On Windows platform the options for video playback are:

1. the browser video player (HTML5)

2. video plugins (NPAPI): Windows Media Player, Quicktime and VLC

3. external video player through a protocol

3.1 Create the viewtube script, batch example using vlc for video playback

viewtube.bat
@echo off
setlocal

set "i=%~1"
set "i=%i:viewtube:=%"
set "i=%i:SEPARATOR=|%"
set "i=%i:||=| |%"
for /f "tokens=1,2,3 delims=|" %%a in ("%i%") do (
   set "v=%%a"
   set "a=%%b"
   set "s=%%c"
)
if "%a%"==" " set "a="
if "%a%"=="" (
   if "%s%"=="" (
      "C:\Program Files\VideoLAN\VLC\vlc.exe" "%v%"
   ) else (
      "C:\Program Files\VideoLAN\VLC\vlc.exe" --sub-file="%s%" "%v%"
   )
) else (
   if "%s%"=="" (
      "C:\Program Files\VideoLAN\VLC\vlc.exe" --input-slave="%a%" "%v%"
   ) else (
      "C:\Program Files\VideoLAN\VLC\vlc.exe" --sub-file="%s%" --input-slave="%a%" "%v%"
   )
)


3.2 Create the viewtube registry file, change the script path and execute it

viewtube.reg
REGEDIT4

[HKEY_CLASSES_ROOT\viewtube]
@="URL:viewtube Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\viewtube\shell]

[HKEY_CLASSES_ROOT\viewtube\shell\open]

[HKEY_CLASSES_ROOT\viewtube\shell\open\command]
@="\"D:\\Scripts\\viewtube.bat\" \"%1\""


3.3 Activate the protocol

Click here to associate the script to the protocol

3.4 Select 'Protocol' in the embed menu from the options window


Mac
On Mac platform the options for video playback are:

1. the browser video player (HTML5)

2. video plugins (NPAPI): Quicktime and VLC