Streamcloud Download Button

This script adds a download button to the streamcloud.eu page.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Streamcloud Download Button
// @namespace   SCDB
// @author      MegaByte
// @description This script adds a download button to the streamcloud.eu page.
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at 	document-end
// @noframes
// @include     http*://*streamcloud.eu/*
// @version     2.0
// ==/UserScript==


var player = $("#player_code");

if(player.length != 0) {
	player.find("script").each(function() {
		var patt = new RegExp("file:\\s?\"http:\\/\\/.+?\\.mp4\"");
		var res = patt.exec($(this).html());
		if(res !== null)
			addButton(res[0].substring(7, res[0].length-1));
	});
}

function addButton(url) {
	$(".container-fluid ul.nav").prepend("<li><a href='" + url + "' download target='_blank'>Download</a></li>")
}