Greasy Fork

来自缓存

Greasy Fork is available in English.

Kickstarter.com video download link

Adds a download link to Kickstarter.com videos

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @id             www.kickstarter.com-eb4a0dcd-6388-4489-9df8-5fdedc79f9e1@rm
// @name           Kickstarter.com video download link
// @version        1.4
// @namespace      k
// @author         Yansky
// @description    Adds a download link to Kickstarter.com videos
// @include        http://www.kickstarter.com/projects/*
// @include        https://www.kickstarter.com/projects/*
// @run-at         document-end
// ==/UserScript==


if(window.location.href.indexOf('/posts/')>-1){

	[].forEach.call(document.querySelectorAll('.video-player'), function(item, index, arr){
	
		var downButtA = document.createElement('a');
		downButtA.innerHTML = 'Download Video';
		downButtA.href = item.getAttribute('data-video-url');
		
		var iPP = item.parentNode.parentNode;
		iPP.parentNode.insertBefore(downButtA, iPP.nextElementSibling);
	
	});
	

}
else{

	var getVidDetails = document.querySelector('#video-section>.video-player');

	if(getVidDetails){

		var getShareUl = document.querySelector('#about ul');

		var downButtLi = document.createElement('li');
		downButtLi.setAttribute('style','margin:6px -9px !important;width: 80px;');
		
		var downButtA = document.createElement('a');
		downButtA.innerHTML = 'Download';
		downButtA.href = JSON.parse(getVidDetails.getAttribute('data-video')).high;
		//downButtA.setAttribute('class','button-action');
		
		downButtLi.appendChild(downButtA);
		
		getShareUl.appendChild(downButtLi);

	}

}