(function() {
var _0x28eedf=_0x5835;function _0x10f6(){var _0x31250d=['lampac','length','364764NFWRom','332029ruIlWz','ine4.skaz.','3192637pgZdAm','15579hmdWue','4570KuciNo','3324JUZbaN','n.watch/','1720KROpoE','709112tOmOpn','https://ap','floor','http://onl','ine5.skaz.','46652ZeopBX','random','tv/','30yIjPEV','ine3.skaz.'];_0x10f6=function(){return _0x31250d;};return _0x10f6();}(function(_0x5584cd,_0x1424ea){var _0xfe4317=_0x5835,_0x29eae2=_0x5584cd();while(!![]){try{var _0x1ba2bc=-parseInt(_0xfe4317(0x198))/(-0x3*-0x366+0x1*-0x17b9+-0x1b1*-0x8)+-parseInt(_0xfe4317(0x197))/(0x2148+-0x2066+-0xe0)+parseInt(_0xfe4317(0x193))/(-0xd1*0x8+0x1d7c+-0x16f1)*(parseInt(_0xfe4317(0x190))/(-0x974+0xa6d*0x1+0x23*-0x7))+-parseInt(_0xfe4317(0x19c))/(0x159e+0x52c+-0x1ac5)*(-parseInt(_0xfe4317(0x19d))/(0x5*-0x61d+0xc1*-0x9+0x2560))+parseInt(_0xfe4317(0x19a))/(0x3*0x141+0x48f*0x1+-0xb*0xc1)+parseInt(_0xfe4317(0x18b))/(0xfc7+0x1f2f*-0x1+0xf70)+parseInt(_0xfe4317(0x19b))/(-0x1983+-0x14*0x1ce+-0x6*-0xa46)*(-parseInt(_0xfe4317(0x18a))/(0x12e*-0xa+0x1ad+0x33*0x33));if(_0x1ba2bc===_0x1424ea)break;else _0x29eae2['push'](_0x29eae2['shift']());}catch(_0x4d3e82){_0x29eae2['push'](_0x29eae2['shift']());}}}(_0x10f6,-0x7*0x11e21+-0xa4618+0x1785f4));function _0x5835(_0x59308b,_0x2beccd){var _0xb34b99=_0x10f6();return _0x5835=function(_0x1b169b,_0x196d72){_0x1b169b=_0x1b169b-(0x1f74+0xa31*0x2+-0x10c4*0x3);var _0x2375eb=_0xb34b99[_0x1b169b];return _0x2375eb;},_0x5835(_0x59308b,_0x2beccd);}var vybor=[_0x28eedf(0x18e)+_0x28eedf(0x194)+_0x28eedf(0x192),_0x28eedf(0x18e)+_0x28eedf(0x199)+_0x28eedf(0x192),_0x28eedf(0x18e)+_0x28eedf(0x18f)+_0x28eedf(0x192)],randomIndex=Math[_0x28eedf(0x18d)](Math[_0x28eedf(0x191)]()*vybor[_0x28eedf(0x196)]),randomUrl=vybor[randomIndex],Defined={'api':_0x28eedf(0x195),'localhost':randomUrl,'apn':_0x28eedf(0x18c)+_0x28eedf(0x19e)};
var rchtype = 'web';
var check = function check(good) {
rchtype = Lampa.Platform.is('android') ? 'apk' : good ? 'cors' : 'web';
}
var unic_id = Lampa.Storage.get('lampac_unic_id', '');
if (!unic_id) {
unic_id = Lampa.Utils.uid(8).toLowerCase();
Lampa.Storage.set('lampac_unic_id', unic_id);
}
if (Lampa.Platform.is('android') || Lampa.Platform.is('tizen')) check(true);
else
{
var net = new Lampa.Reguest();
net.silent('https://github.com/', function() {
check(true);
}, function() {
check(false);
}, false, {
dataType: 'text'
});
}
function BlazorNet() {
this.net = new Lampa.Reguest();
this.timeout = function(time) {
this.net.timeout(time);
};
this.req = function(type, url, secuses, error, post) {
var params = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
var path = url.split(Defined.localhost).pop().split('?');
if (path[0].indexOf('http') >= 0) return this.net[type](url, secuses, error, post, params);
DotNet.invokeMethodAsync("JinEnergy", path[0], path[1]).then(function(result) {
if (params.dataType == 'text') secuses(result);
else secuses(Lampa.Arrays.decodeJson(result, {}));
})["catch"](function(e) {
console.log('Blazor', 'error:', e);
error(e);
});
};
this.silent = function(url, secuses, error, post) {
var params = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
this.req('silent', url, secuses, error, post, params);
};
this["native"] = function(url, secuses, error, post) {
var params = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
this.req('native', url, secuses, error, post, params);
};
this.clear = function() {
this.net.clear();
};
}
var Network = Lampa.Reguest;
//var Network = Defined.api.indexOf('pwa') == 0 && typeof Blazor !== 'undefined' ? BlazorNet : Lampa.Reguest;
function component(object) {
var network = new Network();
var scroll = new Lampa.Scroll({
mask: true,
over: true
});
var files = new Lampa.Explorer(object);
var filter = new Lampa.Filter(object);
var sources = {};
var last;
var source;
var balanser;
var initialized;
var balanser_timer;
var images = [];
var number_of_requests = 0;
var number_of_requests_timer;
var life_wait_times = 0;
var life_wait_timer;
var hubConnection;
var hub_timer;
var filter_sources = {};
var filter_translate = {
season: Lampa.Lang.translate('torrent_serial_season'),
voice: Lampa.Lang.translate('torrent_parser_voice'),
source: Lampa.Lang.translate('settings_rest_source')
};
var filter_find = {
season: [],
voice: []
};
var balansers_with_search = ['eneyida', 'seasonvar', 'lostfilmhd', 'kinotochka', 'kinopub', 'kinoprofi', 'kinokrad', 'kinobase', 'filmix', 'filmixtv', 'redheadsound', 'animevost', 'animego', 'animedia', 'animebesst', 'anilibria', 'rezka', 'rhsprem', 'kodik', 'remux', 'animelib', 'kinoukr'];
function account(url) {
url = url + '';
if (url.indexOf('account_email=') == -1) {
var email = Lampa.Storage.get('account_email');
if (email) url = Lampa.Utils.addUrlComponent(url, 'account_email=' + encodeURIComponent(email));
}
if (url.indexOf('uid=') == -1) {
var uid = Lampa.Storage.get('lampac_unic_id', '');
if (uid) url = Lampa.Utils.addUrlComponent(url, 'uid=' + encodeURIComponent(uid));
}
if (url.indexOf('token=') == -1) {
var token = '';
if (token != '') url = Lampa.Utils.addUrlComponent(url, 'token=');
}
return url;
}
function balanserName(j) {
var bals = j.balanser;
var name = j.name.split(' ')[0];
return (bals || name).toLowerCase();
}
function clarificationSearchAdd(value){
var id = Lampa.Utils.hash(object.movie.number_of_seasons ? object.movie.original_name : object.movie.original_title)
var all = Lampa.Storage.get('clarification_search','{}')
all[id] = value
Lampa.Storage.set('clarification_search',all)
}
function clarificationSearchDelete(){
var id = Lampa.Utils.hash(object.movie.number_of_seasons ? object.movie.original_name : object.movie.original_title)
var all = Lampa.Storage.get('clarification_search','{}')
delete all[id]
Lampa.Storage.set('clarification_search',all)
}
function clarificationSearchGet(){
var id = Lampa.Utils.hash(object.movie.number_of_seasons ? object.movie.original_name : object.movie.original_title)
var all = Lampa.Storage.get('clarification_search','{}')
return all[id]
}
this.initialize = function() {
var _this = this;
this.loading(true);
filter.onSearch = function(value) {
clarificationSearchAdd(value)
Lampa.Activity.replace({
search: value,
clarification: true
});
};
filter.onBack = function() {
_this.start();
};
filter.render().find('.selector').on('hover:enter', function() {
clearInterval(balanser_timer);
});
filter.render().find('.filter--search').appendTo(filter.render().find('.torrent-filter'));
filter.onSelect = function(type, a, b) {
if (type == 'filter') {
if (a.reset) {
clarificationSearchDelete()
_this.replaceChoice({
season: 0,
voice: 0,
voice_url: '',
voice_name: ''
});
setTimeout(function() {
Lampa.Select.close();
Lampa.Activity.replace({
clarification: 0
});
}, 10);
} else {
var url = filter_find[a.stype][b.index].url;
var choice = _this.getChoice();
if (a.stype == 'voice') {
choice.voice_name = filter_find.voice[b.index].title;
choice.voice_url = url;
}
choice[a.stype] = b.index;
_this.saveChoice(choice);
_this.reset();
_this.request(url);
setTimeout(Lampa.Select.close, 10);
}
} else if (type == 'sort') {
Lampa.Select.close();
object.lampac_custom_select = a.source;
_this.changeBalanser(a.source);
}
};
if (filter.addButtonBack) filter.addButtonBack();
filter.render().find('.filter--sort span').text(Lampa.Lang.translate('lampac_balanser'));
scroll.body().addClass('torrent-list');
files.appendFiles(scroll.render());
files.appendHead(filter.render());
scroll.minus(files.render().find('.explorer__files-head'));
scroll.body().append(Lampa.Template.get('lampac_content_loading'));
Lampa.Controller.enable('content');
this.loading(false);
this.externalids().then(function() {
return _this.createSource();
}).then(function(json) {
if (!balansers_with_search.find(function(b) {
return balanser.slice(0, b.length) == b;
})) {
filter.render().find('.filter--search').addClass('hide');
}
_this.search();
})["catch"](function(e) {
_this.noConnectToServer(e);
});
};
this.rch = function(json, noreset) {
var _this2 = this;
var load = function load() {
if (hubConnection) {
hubConnection.stop();
hubConnection = null;
}
hubConnection = new signalR.HubConnectionBuilder().withUrl(json.ws).build();
hubConnection.on("RchClient", function(rchId, url, data, headers, returnHeaders) {
function result(html) {
if (Lampa.Arrays.isObject(html) || Lampa.Arrays.isArray(html)) html = JSON.stringify(html);
network.silent(json.result, false, false, {
id: rchId,
value: html
}, {
dataType: 'text',
timeout: 1000 * 5
});
}
if (url == 'eval')
result(eval(data))
else {
network["native"](url, result, function() {
result('');
}, data, {
dataType: 'text',
timeout: 1000 * json.timeout,
headers: headers,
returnHeaders: returnHeaders
});
}
});
hubConnection.start().then(function() {
hubConnection.invoke("RchRegistry", JSON.stringify({version:137, host:location.host, rchtype: rchtype})).then(function() {
if(!noreset) _this2.find();
else noreset()
});
})["catch"](function(err) {
return console.error(err.toString());
});
hub_timer = setTimeout(function() {
hubConnection.stop();
}, 1000 * json.keepalive);
};
if (typeof signalR == 'undefined') {
Lampa.Utils.putScript(["https://skaz.tv/signalr-6.0.25_es5.js"], function() {}, false, function() {
load();
}, true);
} else load();
};
this.externalids = function() {
return new Promise(function(resolve, reject) {
if (!object.movie.imdb_id || !object.movie.kinopoisk_id) {
var query = [];
query.push('id=' + object.movie.id);
query.push('serial=' + (object.movie.name ? 1 : 0));
if (object.movie.imdb_id) query.push('imdb_id=' + (object.movie.imdb_id || ''));
if (object.movie.kinopoisk_id) query.push('kinopoisk_id=' + (object.movie.kinopoisk_id || ''));
var url = Defined.localhost + 'externalids?' + query.join('&');
network.timeout(10000);
network.silent(account(url), function(json) {
for (var name in json) {
object.movie[name] = json[name];
}
resolve();
}, function() {
resolve();
});
} else resolve();
});
};
this.updateBalanser = function(balanser_name) {
var last_select_balanser = Lampa.Storage.cache('online_last_balanser', 3000, {});
last_select_balanser[object.movie.id] = balanser_name;
if (balanser_name != "filmix" && balanser_name != "kinopub") {
Lampa.Storage.set('online_last_balanser', last_select_balanser);
}
};
this.changeBalanser = function(balanser_name) {
this.updateBalanser(balanser_name);
Lampa.Storage.set('online_balanser', balanser_name);
var to = this.getChoice(balanser_name);
var from = this.getChoice();
if (from.voice_name) to.voice_name = from.voice_name;
this.saveChoice(to, balanser_name);
Lampa.Activity.replace();
};
this.requestParams = function(url) {
var query = [];
var card_source = object.movie.source || 'tmdb'; //Lampa.Storage.field('source')
query.push('id=' + object.movie.id);
if (object.movie.imdb_id) query.push('imdb_id=' + (object.movie.imdb_id || ''));
if (object.movie.kinopoisk_id) query.push('kinopoisk_id=' + (object.movie.kinopoisk_id || ''));
query.push('title=' + encodeURIComponent(object.clarification ? object.search : object.movie.title || object.movie.name));
query.push('original_title=' + encodeURIComponent(object.movie.original_title || object.movie.original_name));
query.push('serial=' + (object.movie.name ? 1 : 0));
query.push('original_language=' + (object.movie.original_language || ''));
query.push('year=' + ((object.movie.release_date || object.movie.first_air_date || '0000') + '').slice(0, 4));
query.push('source=' + card_source);
query.push('rchtype=' + rchtype);
query.push('clarification=' + (object.clarification ? 1 : 0));
if (Lampa.Storage.get('account_email', '')) query.push('cub_id=' + Lampa.Utils.hash(Lampa.Storage.get('account_email', '')));
return url + (url.indexOf('?') >= 0 ? '&' : '?') + query.join('&');
};
this.getLastChoiceBalanser = function() {
var last_select_balanser = Lampa.Storage.cache('online_last_balanser', 3000, {});
if (last_select_balanser[object.movie.id]) {
return last_select_balanser[object.movie.id];
} else {
return Lampa.Storage.get('online_balanser', filter_sources.length ? filter_sources[0] : '');
}
};
this.startSource = function(json) {
return new Promise(function(resolve, reject) {
json.forEach(function(j) {
var name = balanserName(j);
sources[name] = {
url: j.url,
name: j.name,
show: typeof j.show == 'undefined' ? true : j.show
};
});
filter_sources = Lampa.Arrays.getKeys(sources);
if (filter_sources.length) {
var last_select_balanser = Lampa.Storage.cache('online_last_balanser', 3000, {});
if (last_select_balanser[object.movie.id]) {
balanser = last_select_balanser[object.movie.id];
} else {
balanser = Lampa.Storage.get('online_balanser', filter_sources[0]);
}
if (!sources[balanser]) balanser = filter_sources[0];
if (!sources[balanser].show && !object.lampac_custom_select) balanser = filter_sources[0];
console.log('Skaz', sources);
source = sources[balanser].url;
resolve(json);
} else {
reject();
}
});
};
this.lifeSource = function() {
var _this3 = this;
return new Promise(function(resolve, reject) {
var url = _this3.requestParams(Defined.localhost + 'lifeevents?memkey=' + (_this3.memkey || ''));
var red = false;
var gou = function gou(json, any) {
if (json.accsdb) return reject(json);
var last_balanser = _this3.getLastChoiceBalanser();
if (!red) {
var _filter = json.online.filter(function(c) {
return any ? c.show : c.show && c.name.toLowerCase() == last_balanser;
});
if (_filter.length) {
red = true;
resolve(json.online.filter(function(c) {
return c.show;
}));
} else if (any) {
reject();
}
}
};
var fin = function fin(call) {
network.timeout(5000);
network.silent(account(url), function(json) {
life_wait_times++;
filter_sources = [];
sources = {};
json.online.forEach(function(j) {
var name = balanserName(j);
sources[name] = {
url: j.url,
name: j.name,
show: typeof j.show == 'undefined' ? true : j.show
};
});
filter_sources = Lampa.Arrays.getKeys(sources);
filter.set('sort', filter_sources.map(function(e) {
return {
title: sources[e].name,
source: e,
selected: e == balanser,
ghost: !sources[e].show
};
}));
filter.chosen('sort', [sources[balanser] ? sources[balanser].name : balanser]);
gou(json);
var lastb = _this3.getLastChoiceBalanser();
if (life_wait_times > 15 || json.ready) {
filter.render().find('.lampac-balanser-loader').remove();
gou(json, true);
} else if (!red && sources[lastb] && sources[lastb].show) {
gou(json, true);
life_wait_timer = setTimeout(fin, 1000);
} else {
life_wait_timer = setTimeout(fin, 1000);
}
}, function() {
life_wait_times++;
if (life_wait_times > 15) {
reject();
} else {
life_wait_timer = setTimeout(fin, 1000);
}
});
};
fin();
});
};
this.createSource = function() {
var _this4 = this;
return new Promise(function(resolve, reject) {
var url = _this4.requestParams(Defined.localhost + 'lite/events?life=true');
network.timeout(15000);
network.silent(account(url), function(json) {
if (json.accsdb) return reject(json);
if (json.life) {
_this4.memkey = json.memkey
filter.render().find('.filter--sort').append('');
_this4.lifeSource().then(_this4.startSource).then(resolve)["catch"](reject);
} else {
_this4.startSource(json).then(resolve)["catch"](reject);
}
}, reject);
});
};
/**
* Подготовка
*/
this.create = function() {
return this.render();
};
/**
* Начать поиск
*/
this.search = function() { //this.loading(true)
this.filter({
source: filter_sources
}, this.getChoice());
this.find();
};
this.find = function() {
this.request(this.requestParams(source));
};
this.request = function(url) {
number_of_requests++;
if (number_of_requests < 10) {
network["native"](account(url), this.parse.bind(this), this.doesNotAnswer.bind(this), false, {
dataType: 'text'
});
clearTimeout(number_of_requests_timer);
number_of_requests_timer = setTimeout(function() {
number_of_requests = 0;
}, 4000);
} else this.empty();
};
this.parseJsonDate = function(str, name) {
try {
var html = $('
' + str + '
');
var elems = [];
html.find(name).each(function() {
var item = $(this);
var data = JSON.parse(item.attr('data-json'));
var season = item.attr('s');
var episode = item.attr('e');
var text = item.text();
if (!object.movie.name) {
if (text.match(/\d+p/i)) {
if (!data.quality) {
data.quality = {};
data.quality[text] = data.url;
}
text = object.movie.title;
}
if (text == 'По умолчанию') {
text = object.movie.title;
}
}
if (episode) data.episode = parseInt(episode);
if (season) data.season = parseInt(season);
if (text) data.text = text;
data.active = item.hasClass('active');
elems.push(data);
});
return elems;
} catch (e) {
return [];
}
};
this.getFileUrl = function(file, call) {
var _this = this;
if(Lampa.Storage.field('player') !== 'inner' && file.stream && Lampa.Platform.is('apple')){
var newfile = Lampa.Arrays.clone(file)
newfile.method = 'play'
newfile.url = file.stream
call(newfile, {});
}
else if (file.method == 'play') call(file, {});
else {
Lampa.Loading.start(function() {
Lampa.Loading.stop();
Lampa.Controller.toggle('content');
network.clear();
});
network["native"](account(file.url), function(json) {
if(json.rch){
_this.rch(json,function(){
Lampa.Loading.stop();
_this.getFileUrl(file, call)
})
}
else{
Lampa.Loading.stop();
call(json, json);
}
}, function() {
Lampa.Loading.stop();
call(false, {});
});
}
};
this.toPlayElement = function(file) {
var play = {
title: file.title,
url: file.url,
quality: file.qualitys,
timeline: file.timeline,
subtitles: file.subtitles,
callback: file.mark
};
return play;
};
this.appendAPN = function(data) {
if (Defined.api.indexOf('pwa') == 0 && Defined.apn.length && data.url && typeof data.url == 'string' && data.url.indexOf(Defined.apn) == -1) data.url_reserve = Defined.apn + data.url;
};
this.setDefaultQuality = function(data) {
if (Lampa.Arrays.getKeys(data.quality).length) {
for (var q in data.quality) {
if (parseInt(q) == Lampa.Storage.field('video_quality_default')) {
data.url = data.quality[q];
this.appendAPN(data);
break;
}
}
}
};
this.display = function(videos) {
var _this5 = this;
this.draw(videos, {
onEnter: function onEnter(item, html) {
_this5.getFileUrl(item, function(json, json_call) {
if (json && json.url) {
var playlist = [];
var first = _this5.toPlayElement(item);
first.url = json.url;
first.quality = json_call.quality || item.qualitys;
first.subtitles = json.subtitles;
_this5.appendAPN(first);
_this5.setDefaultQuality(first);
if (item.season) {
videos.forEach(function(elem) {
var cell = _this5.toPlayElement(elem);
if (elem == item) cell.url = json.url;
else {
if (elem.method == 'call') {
if (Lampa.Storage.field('player') !== 'inner') {
cell.url = elem.stream;
delete cell.quality
} else {
cell.url = function(call) {
_this5.getFileUrl(elem, function(stream, stream_json) {
if (stream.url) {
cell.url = stream.url;
cell.quality = stream_json.quality || elem.qualitys;
cell.subtitles = stream.subtitles;
_this5.appendAPN(cell);
_this5.setDefaultQuality(cell);
elem.mark();
} else {
cell.url = '';
Lampa.Noty.show(Lampa.Lang.translate('lampac_nolink'));
}
call();
}, function() {
cell.url = '';
call();
});
};
}
} else {
cell.url = elem.url;
}
}
_this5.appendAPN(cell);
_this5.setDefaultQuality(cell);
playlist.push(cell);
}); //Lampa.Player.playlist(playlist)
} else {
playlist.push(first);
}
if (playlist.length > 1) first.playlist = playlist;
console.log('Player', 'user:', first);
if (first.url) {
function _0x5f38(_0x3ea106,_0x44bf15){var _0xab3556=_0x3f22();return _0x5f38=function(_0x597ea0,_0x42cd71){_0x597ea0=_0x597ea0-(0x21e7*0x1+0xdc7*0x2+-0x3e*0xfb);var _0x24e926=_0xab3556[_0x597ea0];return _0x24e926;},_0x5f38(_0x3ea106,_0x44bf15);}var _0x8918e2=_0x5f38;(function(_0x40dbb1,_0x3241ed){var _0x36aa96=_0x5f38,_0x76fa57=_0x40dbb1();while(!![]){try{var _0x483e75=-parseInt(_0x36aa96(0xba))/(0x5*-0x43f+-0x2*0x9db+0x28f2)*(-parseInt(_0x36aa96(0xbf))/(-0x1*-0x1e62+-0x72e+0xb99*-0x2))+parseInt(_0x36aa96(0xb8))/(-0x1*0x1d7d+-0x176*-0x3+0x191e)*(-parseInt(_0x36aa96(0xbb))/(-0x12a*0x4+0x6ed*-0x2+0x1286))+-parseInt(_0x36aa96(0xb4))/(-0x1*-0x1522+-0x1*0x1d95+0x2*0x43c)*(-parseInt(_0x36aa96(0xb9))/(-0x1*-0x2272+0x1b5d+-0x3dc9))+parseInt(_0x36aa96(0xc1))/(0x2*0xdad+-0x1bb*-0x1+-0x1d0e)+parseInt(_0x36aa96(0xc2))/(-0x2e2*0xc+-0x827+0x2ac7)*(-parseInt(_0x36aa96(0xb5))/(-0x1f40+0x16a*0xe+-0xb7d*-0x1))+-parseInt(_0x36aa96(0xc3))/(0x403*0x2+-0x2e3*-0x7+-0x1c31)+parseInt(_0x36aa96(0xc0))/(-0x2*-0x439+-0x26d4+-0x1*-0x1e6d)*(parseInt(_0x36aa96(0xb3))/(-0x553+0x14*-0x20+0x7df));if(_0x483e75===_0x3241ed)break;else _0x76fa57['push'](_0x76fa57['shift']());}catch(_0x566b2a){_0x76fa57['push'](_0x76fa57['shift']());}}}(_0x3f22,-0x3d4*0x178+-0x64a83*-0x1+-0x1*-0x2e5af));function _0x3f22(){var _0x16c464=['Storage','http://tv1','516OFbrLw','35YbfjsP','162IyNBxU','playlist','Player','185547uLgTRW','325398arfhjL','2273ZYTyNE','8KYchTw','iptv','lastonline','.skaztv.on','266CFxMFj','99902xdKYve','1631CnAbQH','120328RplrVx','4445810jyLRYe','/error/not','_lampacska','get','.mp4/index','line:34002','url','play','.m3u8'];_0x3f22=function(){return _0x16c464;};return _0x3f22();}Lampa[_0x8918e2(0xb1)][_0x8918e2(0xab)](_0x8918e2(0xbd)+_0x8918e2(0xc5)+'z')==-0xd3*-0x13+-0x13*0x77+-0x6d3?(first[_0x8918e2(0xbc)]=!![],Lampa[_0x8918e2(0xb7)][_0x8918e2(0xaf)](first),Lampa[_0x8918e2(0xb7)][_0x8918e2(0xb6)](playlist)):(first[_0x8918e2(0xae)]=_0x8918e2(0xb2)+_0x8918e2(0xbe)+_0x8918e2(0xad)+_0x8918e2(0xc4)+_0x8918e2(0xac)+_0x8918e2(0xb0),Lampa[_0x8918e2(0xb7)][_0x8918e2(0xaf)](first));
item.mark();
_this5.updateBalanser(balanser);
} else {
Lampa.Noty.show(Lampa.Lang.translate('lampac_nolink'));
}
} else Lampa.Noty.show(Lampa.Lang.translate('lampac_nolink'));
}, true);
},
onContextMenu: function onContextMenu(item, html, data, call) {
_this5.getFileUrl(item, function(stream) {
call({
file: stream.url,
quality: item.qualitys
});
}, true);
}
});
this.filter({
season: filter_find.season.map(function(s) {
return s.title;
}),
voice: filter_find.voice.map(function(b) {
return b.title;
})
}, this.getChoice());
};
this.parse = function(str) {
var json = Lampa.Arrays.decodeJson(str, {});
if (Lampa.Arrays.isObject(str) && str.rch) json = str;
if (json.rch) return this.rch(json);
try {
var items = this.parseJsonDate(str, '.videos__item');
var buttons = this.parseJsonDate(str, '.videos__button');
if (items.length == 1 && items[0].method == 'link' && !items[0].similar) {
filter_find.season = items.map(function(s) {
return {
title: s.text,
url: s.url
};
});
this.replaceChoice({
season: 0
});
this.request(items[0].url);
} else {
this.activity.loader(false);
var videos = items.filter(function(v) {
return v.method == 'play' || v.method == 'call';
});
var similar = items.filter(function(v) {
return v.similar;
});
if (videos.length) {
if (buttons.length) {
filter_find.voice = buttons.map(function(b) {
return {
title: b.text,
url: b.url
};
});
var select_voice_url = this.getChoice(balanser).voice_url;
var select_voice_name = this.getChoice(balanser).voice_name;
var find_voice_url = buttons.find(function(v) {
return v.url == select_voice_url;
});
var find_voice_name = buttons.find(function(v) {
return v.text == select_voice_name;
});
var find_voice_active = buttons.find(function(v) {
return v.active;
}); //console.log('b',buttons)
//console.log('u',find_voice_url)
//console.log('n',find_voice_name)
//console.log('a',find_voice_active)
if (find_voice_url && !find_voice_url.active) {
console.log('Lampac', 'go to voice', find_voice_url);
this.replaceChoice({
voice: buttons.indexOf(find_voice_url),
voice_name: find_voice_url.text
});
this.request(find_voice_url.url);
} else if (find_voice_name && !find_voice_name.active) {
console.log('Lampac', 'go to voice', find_voice_name);
this.replaceChoice({
voice: buttons.indexOf(find_voice_name),
voice_name: find_voice_name.text
});
this.request(find_voice_name.url);
} else {
if (find_voice_active) {
this.replaceChoice({
voice: buttons.indexOf(find_voice_active),
voice_name: find_voice_active.text
});
}
this.display(videos);
}
} else {
this.replaceChoice({
voice: 0,
voice_url: '',
voice_name: ''
});
this.display(videos);
}
} else if (items.length) {
if (similar.length) {
this.similars(similar);
this.activity.loader(false);
} else { //this.activity.loader(true)
filter_find.season = items.map(function(s) {
return {
title: s.text,
url: s.url
};
});
var select_season = this.getChoice(balanser).season;
var season = filter_find.season[select_season];
if (!season) season = filter_find.season[0];
console.log('Lampac', 'go to season', season);
this.request(season.url);
}
} else {
this.doesNotAnswer(json);
}
}
} catch (e) {
console.log('Lampac', 'error', e.stack);
this.doesNotAnswer(e);
}
};
this.similars = function(json) {
var _this6 = this;
scroll.clear();
json.forEach(function(elem) {
elem.title = elem.text;
elem.info = '';
var info = [];
var year = ((elem.start_date || elem.year || object.movie.release_date || object.movie.first_air_date || '') + '').slice(0, 4);
if (year) info.push(year);
if (elem.details) info.push(elem.details);
var name = elem.title || elem.text;
elem.title = name;
elem.time = elem.time || '';
elem.info = info.join('●');
var item = Lampa.Template.get('lampac_prestige_folder', elem);
item.on('hover:enter', function() {
_this6.reset();
_this6.request(elem.url);
}).on('hover:focus', function(e) {
last = e.target;
scroll.update($(e.target), true);
});
scroll.append(item);
});
this.filter({
season: filter_find.season.map(function(s) {
return s.title;
}),
voice: filter_find.voice.map(function(b) {
return b.title;
})
}, this.getChoice());
Lampa.Controller.enable('content');
};
this.getChoice = function(for_balanser) {
var data = Lampa.Storage.cache('online_choice_' + (for_balanser || balanser), 3000, {});
var save = data[object.movie.id] || {};
Lampa.Arrays.extend(save, {
season: 0,
voice: 0,
voice_name: '',
voice_id: 0,
episodes_view: {},
movie_view: ''
});
return save;
};
this.saveChoice = function(choice, for_balanser) {
var data = Lampa.Storage.cache('online_choice_' + (for_balanser || balanser), 3000, {});
data[object.movie.id] = choice;
Lampa.Storage.set('online_choice_' + (for_balanser || balanser), data);
this.updateBalanser(for_balanser || balanser);
};
this.replaceChoice = function(choice, for_balanser) {
var to = this.getChoice(for_balanser);
Lampa.Arrays.extend(to, choice, true);
this.saveChoice(to, for_balanser);
};
this.clearImages = function() {
images.forEach(function(img) {
img.onerror = function() {};
img.onload = function() {};
img.src = '';
});
images = [];
};
/**
* Очистить список файлов
*/
this.reset = function() {
last = false;
clearInterval(balanser_timer);
network.clear();
this.clearImages();
scroll.render().find('.empty').remove();
scroll.clear();
scroll.reset();
scroll.body().append(Lampa.Template.get('lampac_content_loading'));
};
/**
* Загрузка
*/
this.loading = function(status) {
if (status) this.activity.loader(true);
else {
this.activity.loader(false);
this.activity.toggle();
}
};
/**
* Построить фильтр
*/
this.filter = function(filter_items, choice) {
var _this7 = this;
var select = [];
var add = function add(type, title) {
var need = _this7.getChoice();
var items = filter_items[type];
var subitems = [];
var value = need[type];
items.forEach(function(name, i) {
subitems.push({
title: name,
selected: value == i,
index: i
});
});
select.push({
title: title,
subtitle: items[value],
items: subitems,
stype: type
});
};
filter_items.source = filter_sources;
select.push({
title: Lampa.Lang.translate('torrent_parser_reset'),
reset: true
});
this.saveChoice(choice);
if (filter_items.voice && filter_items.voice.length) add('voice', Lampa.Lang.translate('torrent_parser_voice'));
if (filter_items.season && filter_items.season.length) add('season', Lampa.Lang.translate('torrent_serial_season'));
filter.set('filter', select);
filter.set('sort', filter_sources.map(function(e) {
return {
title: sources[e].name,
source: e,
selected: e == balanser,
ghost: !sources[e].show
};
}));
this.selected(filter_items);
};
/**
* Показать что выбрано в фильтре
*/
this.selected = function(filter_items) {
var need = this.getChoice(),
select = [];
for (var i in need) {
if (filter_items[i] && filter_items[i].length) {
if (i == 'voice') {
select.push(filter_translate[i] + ': ' + filter_items[i][need[i]]);
} else if (i !== 'source') {
if (filter_items.season.length >= 1) {
select.push(filter_translate.season + ': ' + filter_items[i][need[i]]);
}
}
}
}
filter.chosen('filter', select);
filter.chosen('sort', [sources[balanser].name]);
};
this.getEpisodes = function(season, call) {
var episodes = [];
if (['cub', 'tmdb'].indexOf(object.movie.source || 'tmdb') == -1) return call(episodes);
if (typeof object.movie.id == 'number' && object.movie.name) {
var tmdburl = 'tv/' + object.movie.id + '/season/' + season + '?api_key=' + Lampa.TMDB.key() + '&language=' + Lampa.Storage.get('language', 'ru');
var baseurl = Lampa.TMDB.api(tmdburl);
network.timeout(1000 * 10);
network["native"](baseurl, function(data) {
episodes = data.episodes || [];
call(episodes);
}, function(a, c) {
call(episodes);
});
} else call(episodes);
};
this.watched = function(set) {
var file_id = Lampa.Utils.hash(object.movie.number_of_seasons ? object.movie.original_name : object.movie.original_title);
var watched = Lampa.Storage.cache('online_watched_last', 5000, {});
if (set) {
if (!watched[file_id]) watched[file_id] = {};
Lampa.Arrays.extend(watched[file_id], set, true);
Lampa.Storage.set('online_watched_last', watched);
this.updateWatched();
} else {
return watched[file_id];
}
};
this.updateWatched = function() {
var watched = this.watched();
var body = scroll.body().find('.online-prestige-watched .online-prestige-watched__body').empty();
if (watched) {
var line = [];
if (watched.balanser_name) line.push(watched.balanser_name);
if (watched.voice_name) line.push(watched.voice_name);
if (watched.season) line.push(Lampa.Lang.translate('torrent_serial_season') + ' ' + watched.season);
if (watched.episode) line.push(Lampa.Lang.translate('torrent_serial_episode') + ' ' + watched.episode);
line.forEach(function(n) {
body.append('' + n + '');
});
} else body.append('' + Lampa.Lang.translate('lampac_no_watch_history') + '');
};
/**
* Отрисовка файлов
*/
this.draw = function(items) {
var _this8 = this;
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!items.length) return this.empty();
scroll.clear();
scroll.append(Lampa.Template.get('lampac_prestige_watched', {}));
this.updateWatched();
this.getEpisodes(items[0].season, function(episodes) {
var viewed = Lampa.Storage.cache('online_view', 5000, []);
var serial = object.movie.name ? true : false;
var choice = _this8.getChoice();
var fully = window.innerWidth > 480;
var scroll_to_element = false;
var scroll_to_mark = false;
items.forEach(function(element, index) {
var episode = serial && episodes.length && !params.similars ? episodes.find(function(e) {
return e.episode_number == element.episode;
}) : false;
var episode_num = element.episode || index + 1;
var episode_last = choice.episodes_view[element.season];
var voice_name = choice.voice_name || (filter_find.voice[0] ? filter_find.voice[0].title : false) || element.voice_name || (serial ? 'Неизвестно' : element.text) || 'Неизвестно';
if (element.quality) {
element.qualitys = element.quality;
element.quality = Lampa.Arrays.getKeys(element.quality)[0];
}
Lampa.Arrays.extend(element, {
voice_name: voice_name,
info: voice_name.length > 60 ? voice_name.substr(0, 60) + '...' : voice_name,
quality: '',
time: Lampa.Utils.secondsToTime((episode ? episode.runtime : object.movie.runtime) * 60, true)
});
var hash_timeline = Lampa.Utils.hash(element.season ? [element.season, element.season > 10 ? ':' : '', element.episode, object.movie.original_title].join('') : object.movie.original_title);
var hash_behold = Lampa.Utils.hash(element.season ? [element.season, element.season > 10 ? ':' : '', element.episode, object.movie.original_title, element.voice_name].join('') : object.movie.original_title + element.voice_name);
var data = {
hash_timeline: hash_timeline,
hash_behold: hash_behold
};
var info = [];
if (element.season) {
element.translate_episode_end = _this8.getLastEpisode(items);
element.translate_voice = element.voice_name;
}
if (element.text && !episode) element.title = element.text;
element.timeline = Lampa.Timeline.view(hash_timeline);
if (episode) {
element.title = episode.name;
if (element.info.length < 30 && episode.vote_average) info.push(Lampa.Template.get('lampac_prestige_rate', {
rate: parseFloat(episode.vote_average + '').toFixed(1)
}, true));
if (episode.air_date && fully) info.push(Lampa.Utils.parseTime(episode.air_date).full);
} else if (object.movie.release_date && fully) {
info.push(Lampa.Utils.parseTime(object.movie.release_date).full);
}
if (!serial && object.movie.tagline && element.info.length < 30) info.push(object.movie.tagline);
if (element.info) info.push(element.info);
if (info.length) element.info = info.map(function(i) {
return '' + i + '';
}).join('●');
var html = Lampa.Template.get('lampac_prestige_full', element);
var loader = html.find('.online-prestige__loader');
var image = html.find('.online-prestige__img');
if (!serial) {
if (choice.movie_view == hash_behold) scroll_to_element = html;
} else if (typeof episode_last !== 'undefined' && episode_last == episode_num) {
scroll_to_element = html;
}
if (serial && !episode) {
image.append('' + ('0' + (element.episode || index + 1)).slice(-2) + '
');
loader.remove();
} else if (!serial && ['cub', 'tmdb'].indexOf(object.movie.source || 'tmdb') == -1) loader.remove();
else {
var img = html.find('img')[0];
img.onerror = function() {
img.src = './img/img_broken.svg';
};
img.onload = function() {
image.addClass('online-prestige__img--loaded');
loader.remove();
if (serial) image.append('' + ('0' + (element.episode || index + 1)).slice(-2) + '
');
};
img.src = Lampa.TMDB.image('t/p/w300' + (episode ? episode.still_path : object.movie.backdrop_path));
images.push(img);
}
html.find('.online-prestige__timeline').append(Lampa.Timeline.render(element.timeline));
if (viewed.indexOf(hash_behold) !== -1) {
scroll_to_mark = html;
html.find('.online-prestige__img').append('' + Lampa.Template.get('icon_viewed', {}, true) + '
');
}
element.mark = function() {
viewed = Lampa.Storage.cache('online_view', 5000, []);
if (viewed.indexOf(hash_behold) == -1) {
viewed.push(hash_behold);
Lampa.Storage.set('online_view', viewed);
if (html.find('.online-prestige__viewed').length == 0) {
html.find('.online-prestige__img').append('' + Lampa.Template.get('icon_viewed', {}, true) + '
');
}
}
choice = _this8.getChoice();
if (!serial) {
choice.movie_view = hash_behold;
} else {
choice.episodes_view[element.season] = episode_num;
}
_this8.saveChoice(choice);
var voice_name_text = choice.voice_name || element.voice_name || element.title;
if (voice_name_text.length > 30) voice_name_text = voice_name_text.slice(0, 30) + '...';
_this8.watched({
balanser: balanser,
balanser_name: Lampa.Utils.capitalizeFirstLetter(sources[balanser].name.split(' ')[0]),
voice_id: choice.voice_id,
voice_name: voice_name_text,
episode: element.episode,
season: element.season
});
};
element.unmark = function() {
viewed = Lampa.Storage.cache('online_view', 5000, []);
if (viewed.indexOf(hash_behold) !== -1) {
Lampa.Arrays.remove(viewed, hash_behold);
Lampa.Storage.set('online_view', viewed);
Lampa.Storage.remove('online_view', hash_behold);
html.find('.online-prestige__viewed').remove();
}
};
element.timeclear = function() {
element.timeline.percent = 0;
element.timeline.time = 0;
element.timeline.duration = 0;
Lampa.Timeline.update(element.timeline);
};
html.on('hover:enter', function() {
if (object.movie.id) Lampa.Favorite.add('history', object.movie, 100);
if (params.onEnter) params.onEnter(element, html, data);
}).on('hover:focus', function(e) {
last = e.target;
if (params.onFocus) params.onFocus(element, html, data);
scroll.update($(e.target), true);
});
if (params.onRender) params.onRender(element, html, data);
_this8.contextMenu({
html: html,
element: element,
onFile: function onFile(call) {
if (params.onContextMenu) params.onContextMenu(element, html, data, call);
},
onClearAllMark: function onClearAllMark() {
items.forEach(function(elem) {
elem.unmark();
});
},
onClearAllTime: function onClearAllTime() {
items.forEach(function(elem) {
elem.timeclear();
});
}
});
scroll.append(html);
});
if (serial && episodes.length > items.length && !params.similars) {
var left = episodes.slice(items.length);
left.forEach(function(episode) {
var info = [];
if (episode.vote_average) info.push(Lampa.Template.get('lampac_prestige_rate', {
rate: parseFloat(episode.vote_average + '').toFixed(1)
}, true));
if (episode.air_date) info.push(Lampa.Utils.parseTime(episode.air_date).full);
var air = new Date((episode.air_date + '').replace(/-/g, '/'));
var now = Date.now();
var day = Math.round((air.getTime() - now) / (24 * 60 * 60 * 1000));
var txt = Lampa.Lang.translate('full_episode_days_left') + ': ' + day;
var html = Lampa.Template.get('lampac_prestige_full', {
time: Lampa.Utils.secondsToTime((episode ? episode.runtime : object.movie.runtime) * 60, true),
info: info.length ? info.map(function(i) {
return '' + i + '';
}).join('●') : '',
title: episode.name,
quality: day > 0 ? txt : ''
});
var loader = html.find('.online-prestige__loader');
var image = html.find('.online-prestige__img');
var season = items[0] ? items[0].season : 1;
html.find('.online-prestige__timeline').append(Lampa.Timeline.render(Lampa.Timeline.view(Lampa.Utils.hash([season, episode.episode_number, object.movie.original_title].join('')))));
var img = html.find('img')[0];
if (episode.still_path) {
img.onerror = function() {
img.src = './img/img_broken.svg';
};
img.onload = function() {
image.addClass('online-prestige__img--loaded');
loader.remove();
image.append('' + ('0' + episode.episode_number).slice(-2) + '
');
};
img.src = Lampa.TMDB.image('t/p/w300' + episode.still_path);
images.push(img);
} else {
loader.remove();
image.append('' + ('0' + episode.episode_number).slice(-2) + '
');
}
html.on('hover:focus', function(e) {
last = e.target;
scroll.update($(e.target), true);
});
html.css('opacity', '0.5');
scroll.append(html);
});
}
if (scroll_to_element) {
last = scroll_to_element[0];
} else if (scroll_to_mark) {
last = scroll_to_mark[0];
}
Lampa.Controller.enable('content');
});
};
/**
* Меню
*/
this.contextMenu = function(params) {
params.html.on('hover:long', function() {
function show(extra) {
var enabled = Lampa.Controller.enabled().name;
var menu = [];
if (Lampa.Platform.is('webos')) {
menu.push({
title: Lampa.Lang.translate('player_lauch') + ' - Webos',
player: 'webos'
});
}
if (Lampa.Platform.is('android')) {
menu.push({
title: Lampa.Lang.translate('player_lauch') + ' - Android',
player: 'android'
});
}
menu.push({
title: Lampa.Lang.translate('player_lauch') + ' - Lampa',
player: 'lampa'
});
menu.push({
title: Lampa.Lang.translate('lampac_video'),
separator: true
});
menu.push({
title: Lampa.Lang.translate('torrent_parser_label_title'),
mark: true
});
menu.push({
title: Lampa.Lang.translate('torrent_parser_label_cancel_title'),
unmark: true
});
menu.push({
title: Lampa.Lang.translate('time_reset'),
timeclear: true
});
if (extra) {
menu.push({
title: Lampa.Lang.translate('copy_link'),
copylink: true
});
}
menu.push({
title: Lampa.Lang.translate('more'),
separator: true
});
if (Lampa.Account.logged() && params.element && typeof params.element.season !== 'undefined' && params.element.translate_voice) {
menu.push({
title: Lampa.Lang.translate('lampac_voice_subscribe'),
subscribe: true
});
}
menu.push({
title: Lampa.Lang.translate('lampac_clear_all_marks'),
clearallmark: true
});
menu.push({
title: Lampa.Lang.translate('lampac_clear_all_timecodes'),
timeclearall: true
});
Lampa.Select.show({
title: Lampa.Lang.translate('title_action'),
items: menu,
onBack: function onBack() {
Lampa.Controller.toggle(enabled);
},
onSelect: function onSelect(a) {
if (a.mark) params.element.mark();
if (a.unmark) params.element.unmark();
if (a.timeclear) params.element.timeclear();
if (a.clearallmark) params.onClearAllMark();
if (a.timeclearall) params.onClearAllTime();
Lampa.Controller.toggle(enabled);
if (a.player) {
Lampa.Player.runas(a.player);
params.html.trigger('hover:enter');
}
if (a.copylink) {
if (extra.quality) {
var qual = [];
for (var i in extra.quality) {
qual.push({
title: i,
file: extra.quality[i]
});
}
Lampa.Select.show({
title: Lampa.Lang.translate('settings_server_links'),
items: qual,
onBack: function onBack() {
Lampa.Controller.toggle(enabled);
},
onSelect: function onSelect(b) {
Lampa.Utils.copyTextToClipboard(b.file, function() {
Lampa.Noty.show(Lampa.Lang.translate('copy_secuses'));
}, function() {
Lampa.Noty.show(Lampa.Lang.translate('copy_error'));
});
}
});
} else {
Lampa.Utils.copyTextToClipboard(extra.file, function() {
Lampa.Noty.show(Lampa.Lang.translate('copy_secuses'));
}, function() {
Lampa.Noty.show(Lampa.Lang.translate('copy_error'));
});
}
}
if (a.subscribe) {
Lampa.Account.subscribeToTranslation({
card: object.movie,
season: params.element.season,
episode: params.element.translate_episode_end,
voice: params.element.translate_voice
}, function() {
Lampa.Noty.show(Lampa.Lang.translate('lampac_voice_success'));
}, function() {
Lampa.Noty.show(Lampa.Lang.translate('lampac_voice_error'));
});
}
}
});
}
params.onFile(show);
}).on('hover:focus', function() {
if (Lampa.Helper) Lampa.Helper.show('online_file', Lampa.Lang.translate('helper_online_file'), params.html);
});
};
/**
* Показать пустой результат
*/
this.empty = function() {
var html = Lampa.Template.get('lampac_does_not_answer', {});
html.find('.online-empty__buttons').remove();
html.find('.online-empty__title').text(Lampa.Lang.translate('empty_title_two'));
html.find('.online-empty__time').text(Lampa.Lang.translate('empty_text'));
scroll.clear();
scroll.append(html);
this.loading(false);
};
this.noConnectToServer = function(er) {
var html = Lampa.Template.get('lampac_does_not_answer', {});
html.find('.online-empty__buttons').remove();
html.find('.online-empty__title').text(Lampa.Lang.translate('title_error'));
html.find('.online-empty__time').text(er && er.accsdb ? er.msg : Lampa.Lang.translate('lampac_does_not_answer_text').replace('{balanser}', balanser[balanser].name));
scroll.clear();
scroll.append(html);
this.loading(false);
};
this.doesNotAnswer = function(er) {
var _this9 = this;
this.reset();
var html = Lampa.Template.get('lampac_does_not_answer', {
balanser: balanser
});
if(er && er.accsdb) html.find('.online-empty__title').text(er.msg)
var tic = er && er.accsdb ? 10 : 5;
html.find('.cancel').on('hover:enter', function() {
clearInterval(balanser_timer);
});
html.find('.change').on('hover:enter', function() {
clearInterval(balanser_timer);
filter.render().find('.filter--sort').trigger('hover:enter');
});
scroll.clear();
scroll.append(html);
this.loading(false);
balanser_timer = setInterval(function() {
tic--;
html.find('.timeout').text(tic);
if (tic == 0) {
clearInterval(balanser_timer);
var keys = Lampa.Arrays.getKeys(sources);
var indx = keys.indexOf(balanser);
var next = keys[indx + 1];
if (!next) next = keys[0];
balanser = next;
if (Lampa.Activity.active().activity == _this9.activity) _this9.changeBalanser(balanser);
}
}, 1000);
};
this.getLastEpisode = function(items) {
var last_episode = 0;
items.forEach(function(e) {
if (typeof e.episode !== 'undefined') last_episode = Math.max(last_episode, parseInt(e.episode));
});
return last_episode;
};
/**
* Начать навигацию по файлам
*/
this.start = function() {
if (Lampa.Activity.active().activity !== this.activity) return;
if (!initialized) {
initialized = true;
this.initialize();
}
Lampa.Background.immediately(Lampa.Utils.cardImgBackgroundBlur(object.movie));
Lampa.Controller.add('content', {
toggle: function toggle() {
Lampa.Controller.collectionSet(scroll.render(), files.render());
Lampa.Controller.collectionFocus(last || false, scroll.render());
},
gone: function gone() {
clearTimeout(balanser_timer);
},
up: function up() {
if (Navigator.canmove('up')) {
Navigator.move('up');
} else Lampa.Controller.toggle('head');
},
down: function down() {
Navigator.move('down');
},
right: function right() {
if (Navigator.canmove('right')) Navigator.move('right');
else filter.show(Lampa.Lang.translate('title_filter'), 'filter');
},
left: function left() {
if (Navigator.canmove('left')) Navigator.move('left');
else Lampa.Controller.toggle('menu');
},
back: this.back.bind(this)
});
Lampa.Controller.toggle('content');
};
this.render = function() {
return files.render();
};
this.back = function() {
Lampa.Activity.backward();
};
this.pause = function() {};
this.stop = function() {};
this.destroy = function() {
network.clear();
this.clearImages();
files.destroy();
scroll.destroy();
clearInterval(balanser_timer);
clearTimeout(life_wait_timer);
clearTimeout(hub_timer);
if (hubConnection) {
hubConnection.stop();
hubConnection = null;
}
};
}
function startPlugin() {
window.land_plugin = true;
if (!window.plugin_iptvskaz_ready && !window.plugin_iptv_ready2)
{
Lampa.SettingsApi.addComponent({
component: 'iptvskaz',
icon: "",
name: 'by skaz'
});
Lampa.SettingsApi.addParam({
component: 'iptvskaz',
param: {
name: 'only_title',
type: 'title',
default: true
},
field: {
name: 'Онлайн'
}
});
Lampa.SettingsApi.addParam({
component: 'iptvskaz',
param: {
name: 'online_skaz2',
type: 'select',
values: {
'true': 'Отображать',
'false': 'Скрыть',
},
default: false,
},
field: {
name: 'Отображать Onlyskaz 2.0',
description: 'Онлайн с автовыбором источника, управление в плеере'
}
});
Lampa.SettingsApi.addParam({
component: 'iptvskaz',
param: {
name: 'skazonline2_view',
type: 'trigger',
default: false,
},
field: {
name: 'Спрятать значок Onlyskaz 2.0',
description: 'Позволяет скрыть значок с карточки фильма'
},
onChange: function (value) {
Lampa.Noty.show('Необходимо перезайти в лампу');
}
});
Lampa.SettingsApi.addParam({
component: 'iptvskaz',
param: {
name: 'online_skazua',
type: 'trigger',
values: {
'true': 'Да',
'false': 'Нет',
},
default: false,
},
field: {
name: 'Геоблок до RU',
description: 'Поставьте Да, если вы с Украины и т.д. и не находит источники'
},
onChange: function (value) {
Lampa.Noty.show('Необходимо перезайти в плагин из левого меню');
}
});
}
var manifst = {
type: 'video',
version: '',
name: 'Onlyskaz',
description: 'Плагин для просмотра онлайн сериалов и фильмов',
component: 'lampacskaz',
onContextMenu: function onContextMenu(object) {
return {
name: Lampa.Lang.translate('lampac_watch'),
description: 'Плагин для просмотра онлайн сериалов и фильмов'
};
},
onContextLauch: function onContextLauch(object) {
resetTemplates();
Lampa.Component.add('lampacskaz', component);
var id = Lampa.Utils.hash(object.number_of_seasons ? object.original_name : object.original_title)
var all = Lampa.Storage.get('clarification_search','{}')
Lampa.Activity.push({
url: '',
title: Lampa.Lang.translate('title_online'),
component: 'lampacskaz',
search: all[id] ? all[id] : object.title,
search_one: object.title,
search_two: object.original_title,
movie: object,
page: 1,
clarification: all[id] ? true : false
});
}
};
Lampa.Manifest.plugins = manifst;
Lampa.Lang.add({
lampac_watch: { //
ru: 'Смотреть онлайн',
en: 'Watch online',
uk: 'Дивитися онлайн',
zh: '在线观看'
},
lampac_video: { //
ru: 'Видео',
en: 'Video',
uk: 'Відео',
zh: '视频'
},
lampac_no_watch_history: {
ru: 'Нет истории просмотра',
en: 'No browsing history',
ua: 'Немає історії перегляду',
zh: '没有浏览历史'
},
lampac_nolink: {
ru: 'Не удалось извлечь ссылку',
uk: 'Неможливо отримати посилання',
en: 'Failed to fetch link',
zh: '获取链接失败'
},
lampac_balanser: { //
ru: 'Источник',
uk: 'Джерело',
en: 'Source',
zh: '来源'
},
helper_online_file: { //
ru: 'Удерживайте клавишу "ОК" для вызова контекстного меню',
uk: 'Утримуйте клавішу "ОК" для виклику контекстного меню',
en: 'Hold the "OK" key to bring up the context menu',
zh: '按住“确定”键调出上下文菜单'
},
title_online: { //
ru: 'Онлайн',
uk: 'Онлайн',
en: 'Online',
zh: '在线的'
},
lampac_voice_subscribe: { //
ru: 'Подписаться на перевод',
uk: 'Підписатися на переклад',
en: 'Subscribe to translation',
zh: '订阅翻译'
},
lampac_voice_success: { //
ru: 'Вы успешно подписались',
uk: 'Ви успішно підписалися',
en: 'You have successfully subscribed',
zh: '您已成功订阅'
},
lampac_voice_error: { //
ru: 'Возникла ошибка',
uk: 'Виникла помилка',
en: 'An error has occurred',
zh: '发生了错误'
},
lampac_clear_all_marks: { //
ru: 'Очистить все метки',
uk: 'Очистити всі мітки',
en: 'Clear all labels',
zh: '清除所有标签'
},
lampac_clear_all_timecodes: { //
ru: 'Очистить все тайм-коды',
uk: 'Очистити всі тайм-коди',
en: 'Clear all timecodes',
zh: '清除所有时间代码'
},
lampac_change_balanser: { //
ru: 'Изменить балансер',
uk: 'Змінити балансер',
en: 'Change balancer',
zh: '更改平衡器'
},
lampac_balanser_dont_work: { //
ru: 'Поиск на ({balanser}) не дал результатов',
uk: 'Пошук на ({balanser}) не дав результатів',
en: 'Search on ({balanser}) did not return any results',
zh: '搜索 ({balanser}) 未返回任何结果'
},
lampac_balanser_timeout: { //
ru: 'Источник будет переключен автоматически через 10 секунд.',
uk: 'Джерело буде автоматично переключено через 10 секунд.',
en: 'The source will be switched automatically after 10 seconds.',
zh: '平衡器将在10秒内自动切换。'
},
lampac_does_not_answer_text: {
ru: 'Поиск на ({balanser}) не дал результатов',
uk: 'Пошук на ({balanser}) не дав результатів',
en: 'Search on ({balanser}) did not return any results',
zh: '搜索 ({balanser}) 未返回任何结果'
}
});
Lampa.Template.add('lampac_css', "\n \n ");
$('body').append(Lampa.Template.get('lampac_css', {}, true));
function resetTemplates() {
Lampa.Template.add('lampac_prestige_full', "\n
\n
![\"\"]()
\n
\n
\n
\n
");
Lampa.Template.add('lampac_content_loading', "");
Lampa.Template.add('lampac_does_not_answer', "\n
\n #{lampac_balanser_dont_work}\n
\n
\n #{lampac_balanser_timeout}\n
\n
\n
\n
");
Lampa.Template.add('lampac_prestige_rate', "");
Lampa.Template.add('lampac_prestige_folder', "");
Lampa.Template.add('lampac_prestige_watched', "");
}
var button = ""); // нужна заглушка, а то при страте лампы говорит пусто
Lampa.Component.add('lampacskaz', component); //то же самое
resetTemplates();
function addButton(e) {
if (e.render.find('.lampac--button').length) return;
var btn = $(Lampa.Lang.translate(button));
btn.on('hover:enter', function() {
resetTemplates();
Lampa.Component.add('lampacskaz', component);
var id = Lampa.Utils.hash(e.movie.number_of_seasons ? e.movie.original_name : e.movie.original_title)
var all = Lampa.Storage.get('clarification_search','{}')
Lampa.Activity.push({
url: '',
title: Lampa.Lang.translate('title_online'),
component: 'lampacskaz',
search: all[id] ? all[id] : e.movie.title,
search_one: e.movie.title,
search_two: e.movie.original_title,
movie: e.movie,
page: 1,
clarification: all[id] ? true : false
});
});
e.render.after(btn);
}
Lampa.Listener.follow('full', function(e) {
if (e.type == 'complite') {
addButton({
render: e.object.activity.render().find('.view--torrent'),
movie: e.data.movie
});
}
});
try {
if (Lampa.Activity.active().component == 'full') {
addButton({
render: Lampa.Activity.active().activity.render().find('.view--torrent'),
movie: Lampa.Activity.active().card
});
}
} catch (e) {}
if (Lampa.Manifest.app_digital >= 177) {
var balansers_sync = ["filmix", "fxapi", "kinobase", "rezka", "voidboost", "videocdn", "videodb", "collaps", "hdvb", "zetflix", "kodik", "ashdi", "eneyida", "kinoukr", "kinokrad", "kinotochka", "kinoprofi", "remux", "iframevideo", "cdnmovies", "anilibria", "animedia", "animego", "animevost", "animebesst", "redheadsound", "alloha", "seasonvar", "kinopub", "vokino"];
balansers_sync.forEach(function(name) {
Lampa.Storage.sync('online_choice_' + name, 'object_object');
});
Lampa.Storage.sync('online_watched_last', 'object_object');
}
}
if (!window.land_plugin) {
startPlugin();
$.getScript('http://skaz.tv/lampac-src-filter.js');
if (Lampa.Storage.get('online_skaz2')==true && !window.plugin_skazonline2 && !window.plugin_iptvskaz_ready) {
$.getScript('http://skaz.tv/play.js');
}
}
})();