// Generated by CoffeeScript 1.10.0
(function () {
var adMode, createFailedItem, createItem, createItemWithKey, errorInfo, info, matrix, player, progressInfo, reset, responseData, saveInfo, updateQueue, updateStatus, utf8ToB64, workMode;
player = null;
responseData = null;
matrix = function () {
return true;
};
workMode = 'doNotLogin';
adMode = 'linkvertise';
utf8ToB64 = function (str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
return String.fromCharCode('0x' + p1);
}));
};
reset = function () {
$('#loader').hide();
$('#text-info').hide();
$('#downloading-info').hide();
$('#download').show();
return $('#url').removeAttr('disabled');
};
info = function (message, color, doReset, bold) {
if (doReset) {
reset();
}
$('#text-info').css('color', color);
if (bold) {
$('#text-info').css('font-weight', 'bold');
} else {
$('#text-info').css('font-weight', 'normal');
}
$('#text-info').html(message);
return $('#text-info').show();
};
saveInfo = function () {
var message;
message = 'By zapisać film ';
if (matrix()) {
message = 'Kliknij na wybraną jakość wideo, ';
switch (adMode) {
case 'shink':
message += 'wypełnij reCaptche, poczekaj 3 sekundy i naciśnij "GET LINK"';
break;
case 'linkvertise':
message += 'kliknij "Free Acceess with Ads", a następnie "Skip >|" na obrazku';
break;
default:
message += 'odczekaj 5 sekund, a następnie naciśnij "SKIP AD" w rogu ekranu';
}
} else {
if (mobileCheck()) {
message += 'długo przyciśnij wybraną jakość wideo i kliknij \'Zapisz link\' lub \'Download\'';
} else if (isFirefox()) {
message += 'kliknij prawym przyciskiem myszy na wybraną jakość wideo i następnie \'Zapisz element docelowy jako\'';
} else {
message += 'kliknij na wybraną jakość wideo';
}
}
return info(message, 'blue', false, matrix());
};
errorInfo = function (message) {
return info(message, 'red', true);
};
progressInfo = function (message) {
return info(message, 'green', false);
};
createItem = function (item) {
return $('#results-list').prepend('' + ' ' + item['extension'] + ' | ' + item['size'] + '' + item['quality'] + '
' + '
' + item['extension'] + ' | ' + item['size'] + '
' + errorMessage + '
'); }; updateQueue = function (n) { if (n > 0) { return progressInfo('Twój film jest ' + n + ' w kolejce pobierania'); } else if (n === 0) { return progressInfo('Pobieranie informacji o filmie...'); } }; updateStatus = function (q) { return progressInfo("Przechwytywanie linku do jakości: [" + q + "]..."); }; $(document).ready(function () { var socket; if (adblock) { ga('send', 'event', 'AdBlock', 'adblock enabled'); } else { ga('send', 'event', 'AdBlock', 'adblock disabled'); } player = videojs("video-player", { plugins: { videoJsResolutionSwitcher: { dynamicLabel: true, "default": 'high' } } }); player.ready(function () { var aspectRatio, myPlayer, resizeVideoJS; myPlayer = this; aspectRatio = 9 / 16; resizeVideoJS = function () { var width; width = document.getElementById("video-player").parentElement.offsetWidth; return myPlayer.width(width).height(width * aspectRatio); }; resizeVideoJS(); return window.onresize = resizeVideoJS; }); $('video').on('contextmenu', function (e) { return e.preventDefault(); }); if (!id) { $('#url').focus(); } socket = io(); socket.on('queue', function (n) { return updateQueue(n); }); socket.on('update queue', function () { return updateQueue($('#queue').text() - 1); }); socket.on('update status', function (q) { return updateStatus(q); }); socket.on('start', function () { return updateQueue(0); }); socket.on('response', function (data) { var errorText, item, key, links, ref, ref1, value; reset(); if (data.status === 'ok') { ref = data.failed; for (key in ref) { value = ref[key]; createFailedItem(value); } if (Object.keys(data.data).length > 0) { links = new Array(); responseData = data; ref1 = data.data; for (key in ref1) { item = ref1[key]; if (item['extension'] === 'mp4') { links.push({ type: 'video/' + item['extension'], src: item['link'], label: item['quality'] }); } if (matrix()) { createItemWithKey(key, item); } else { createItem(item); } } links.reverse(); if (links.length > 0) { player.updateSrc(links); } } else { $('#footer').hide(); } $("#title").html("" + data.name + "