Motherless Video Downloader

Motherless Video Downloader script

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name            Motherless Video Downloader
// @namespace       MoViDo
// @description:en  Motherless Video Downloader script
// @include         http://motherless.com/*
// @homepage        http://userscripts.org/scripts/show/100154
// @updateurl       http://userscripts.org/scripts/source/100154.user.js
// @version         1.2
// @description Motherless Video Downloader script
// ==/UserScript==

var I_Have_A_Realy_Old_Browser = false; // Set this to true if you use IE7, FF3.5 or CHROME10 ( or older )

var re = /http:\/\/.+\d\.flv\/.+\.flv/;
var str = document.getElementById('media-media').innerHTML;
var link = str.match(re, "$1");

if (I_Have_A_Realy_Old_Browser) {
	if (link !== null) {
		document.getElementById('media-media').innerHTML += '<h2><br><a href="' + link + '?start=0">Direct Download</a></h2>';
	}
} else {
	GM_xmlhttpRequest({
		url: link + '?start=0',
		method: "HEAD",
		onload: function(response) {

			var re = /\d+/g;
			var str = response.responseHeaders.match(/Content-Length: \d+/);
			var str = str.toString();
			var size = str.match(re, "$1");
			size = (size / 1024) / 1024;
			size = size.toFixed(2);

			if (link !== null) {
				document.getElementById('media-media').innerHTML += '<h2><br><a href="' + link + '?start=0">Direct Download (' + size + ' MB)</a></h2>';
			}
		}
	});
}