About
SaveTube is a JavaScript application that allows downloading videos from video sharing web sites by adding on the bottom right of the page window a menu with all formats and definitions of the video. Below are all supported sites. There is an extra script that gets all video streams from an web page.


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



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 SaveTube 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 then dragged and dropped in the extensions page or installed with the Tampermonkey or Violentmonkey extension from Chrome Web Store. Or manually download and install the SaveTube extension from here.

Epiphany
To work in Epiphany (Gnome Web) it is required to install the Greasemonkey extension from Epiphany extensions.

Midori
To work in Midori it is required to enable the User Addons 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 then dragged and dropped in the extensions page or installed with extensions, Tampermonkey from Opera Add-ons or Violentmonkey. Or manually download and install the SaveTube 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.

Maxthon
To work in Maxthon it is require to install the SaveTube extension or to install the script in the Violentmonkey extension.

Safari
To work in Safari it is required to install one of GreaseKit, NinjaKit or Tampermonkey.



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.

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". Download both streams and use an external tool to multiplex them. This can be made automatic, enable DASH download support in the options window and the videos menu will show new videos as "Video With Audio". You can download these using a browser protocol and an external script, read below for more details.

Options
Click the vertical dots to open the options window.

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

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

Autoget
Enable/disable video auto-download. If it's on the video download will start when the video page is loaded or when a new video format is selected. This works for "High Definition MP4" YouTube videos only.

DASH
Enable/disable DASH streams (video with audio) download. It requires an external application for muxing the audio and video streams



Linux
How to download DASH videos on Linux and BSD platforms:

1 Create the savetube script, bash example using ffmpeg for audio and video streams multiplexing

savetube.sh
#! /bin/bash

d="/home/Video/YouTube"
s="$(echo "$1" | sed -e "s/savetube://")"
t="$(echo "$s" | awk -F 'SEPARATOR' '{print $1}' | sed -e "s/%20/ /g" -e "s/ +$//" -e "s/^ +//")"
v="$(echo "$s" | awk -F 'SEPARATOR' '{print $2}')"
a="$(echo "$s" | awk -F 'SEPARATOR' '{print $3}')"
f="$(echo "$v" | grep -qi "video/webm\|\.webm" && echo "webm" || echo "mp4")"
ffmpeg -i "$v" -i "$a" -c:v copy -c:a copy "$d/$t.$f"


2 Create the savetube protocol file in ~/.local/share/applications

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


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


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


3 Activate the protocol

Click here to associate the script to the protocol

3.4 Enable DASH download support in the options window



Windows
How to download DASH videos on Windows:

1 Create the savetube script, batch example using ffmpeg for audio and video streams multiplexing

savetube.bat
@echo off
setlocal

set "d=D:\Videos"
set "i=%1"
set "s=%i:savetube:=%"
for /f "tokens=1,2,3 delims=SEPARATOR" %%a in ("%s%") do (
   set "t=%%a"
   set "v=%%b"
   set "a=%%c"
)
set "f=mp4"
if not "x%v:video/webm=%"=="x%v%" set "f=webm"
if not "x%v:.webm=%"=="x%v%" set "f=webm"
"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -i "%v%" -i "%a%" -c:v copy -c:a copy "%d%\%t%.%f%"


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

savetube.reg
REGEDIT4

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

[HKEY_CLASSES_ROOT\savetube\shell]

[HKEY_CLASSES_ROOT\savetube\shell\open]

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


3.3 Activate the protocol

Click here to associate the script to the protocol

3.4 Enable DASH download support in the options window