Streamcloud Download Button

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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>")
}