154 lines
5.9 KiB
JavaScript
154 lines
5.9 KiB
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
// Не предлагать выбор языка при первом запуске лампы
|
|
if (!localStorage.getItem('language')) {
|
|
localStorage.setItem('language', 'ru');
|
|
localStorage.setItem('tmdb_lang', 'ru');
|
|
}
|
|
|
|
// Первоначальная сортировка меню
|
|
if (!localStorage.getItem('menu_sort'))
|
|
localStorage.setItem('menu_sort', '["Главная","Фильмы","Сериалы","Избранное","История","Релизы","Каталог","Фильтр","Расписание","Торренты","Клубничка","Аниме"]');
|
|
|
|
if ('{country}' == 'RU')
|
|
localStorage.setItem('cub_domain', 'mirror-kurwa.men');
|
|
else
|
|
localStorage.setItem('cub_domain', 'cub.red');
|
|
|
|
window.lampa_settings = {
|
|
torrents_use: true, // кнопка торренты включена
|
|
demo: false, // demo off
|
|
read_only: false, // demo off
|
|
socket_use: false, // cub
|
|
account_use: true, // сохраним ради расширенных закладок
|
|
account_sync: true, // cub синхронизация
|
|
plugins_store: false, // cub магазин
|
|
feed: false, // cub лента
|
|
white_use: false, // cub
|
|
push_state: false, // адрес в url /?card=1241982&media=movie
|
|
lang_use: false, // выбор языка в настройках
|
|
plugins_use: true // настройки, расширения
|
|
}
|
|
|
|
window.lampa_settings.disable_features = {
|
|
dmca: true, // шлет нахер правообладателей - on
|
|
reactions: false, // cub реакции - on
|
|
discuss: false, // cub комментарии - on
|
|
ai: false, // cub AI-поиск - on
|
|
install_proxy: true, // cub tmdb proxy - off
|
|
subscribe: true, // cub подписки - off
|
|
blacklist: true, // off
|
|
persons: true // off
|
|
}
|
|
|
|
{lampainit-invc}
|
|
|
|
var timer = setInterval(function() {
|
|
if (typeof Lampa !== 'undefined') {
|
|
clearInterval(timer);
|
|
|
|
if (window.lampainit_invc)
|
|
window.lampainit_invc.appload();
|
|
|
|
if ({btn_priority_forced})
|
|
Lampa.Storage.set('full_btn_priority', '{full_btn_priority_hash}');
|
|
|
|
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);
|
|
}
|
|
|
|
Lampa.Utils.putScriptAsync(["{localhost}/cubproxy.js", "{localhost}/privateinit.js?account_email=" + encodeURIComponent(Lampa.Storage.get('account_email', '')) + "&uid=" + encodeURIComponent(Lampa.Storage.get('lampac_unic_id', ''))], function() {});
|
|
|
|
if (!Lampa.Storage.get('lampac_initiale', 'false')) {
|
|
if (window.appready) {
|
|
if (window.lampainit_invc) window.lampainit_invc.appready();
|
|
start();
|
|
}
|
|
else {
|
|
Lampa.Listener.follow('app', function(e) {
|
|
if (e.type == 'ready') {
|
|
if (window.lampainit_invc) window.lampainit_invc.appready();
|
|
start();
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
{deny}
|
|
{pirate_store}
|
|
}
|
|
}, 200);
|
|
|
|
function start() {
|
|
Lampa.Storage.set('lampac_initiale', 'true');
|
|
Lampa.Storage.set('source', 'cub');
|
|
Lampa.Storage.set('video_quality_default', '2160');
|
|
Lampa.Storage.set('full_btn_priority', '{full_btn_priority_hash}');
|
|
Lampa.Storage.set('proxy_tmdb_auto', '{country}' == 'RU'); // Для RU включить tmdb proxy
|
|
Lampa.Storage.set('proxy_tmdb', '{country}' == 'RU');
|
|
Lampa.Storage.set('poster_size', 'w300');
|
|
Lampa.Storage.set('animation', 'false'); // Анимация отключена
|
|
|
|
Lampa.Storage.set('parser_use', 'true');
|
|
Lampa.Storage.set('jackett_url', '{jachost}');
|
|
Lampa.Storage.set('jackett_key', '1');
|
|
Lampa.Storage.set('parser_torrent_type', 'jackett');
|
|
|
|
var plugins = Lampa.Plugins.get();
|
|
|
|
var plugins_add = [{initiale}];
|
|
|
|
var plugins_push = []
|
|
|
|
plugins_add.forEach(function(plugin) {
|
|
if (!plugins.find(function(a) {
|
|
return a.url == plugin.url
|
|
})) {
|
|
Lampa.Plugins.add(plugin);
|
|
Lampa.Plugins.save();
|
|
|
|
plugins_push.push(plugin.url)
|
|
}
|
|
});
|
|
|
|
if (plugins_push.length) Lampa.Utils.putScript(plugins_push, function() {}, function() {}, function() {}, true);
|
|
|
|
if (window.lampainit_invc)
|
|
window.lampainit_invc.first_initiale();
|
|
|
|
// Загружаем tmdbproxy, cubproxy
|
|
Lampa.Utils.putScriptAsync(["{localhost}/tmdbproxy.js", "{localhost}/cubproxy.js"], function() {});
|
|
|
|
// Скрыть меню в настройках - Синхронизация, Парсер, TorrServer, IPTV, Расширения, TMDB
|
|
// $(['account', 'parser', 'server', 'iptv', 'plugins'].map(function(c) {
|
|
Lampa.Settings.listener.follow('open', function(e) {
|
|
$(['interface', 'parental_control', 'iptv', 'plugins'].map(function(c) {
|
|
return '[data-component="' + c + '"]';
|
|
}).join(','), e.body).remove();
|
|
});
|
|
|
|
Lampa.Listener.follow('full', (e) => {
|
|
if (e.type == 'complite') {
|
|
e.object.activity.render().find('.button--subscribe').remove(); // cub подписка на озвучку
|
|
$('.open--broadcast').remove(); // открыть на другом устройстве (не работает если отключен cub socket)
|
|
}
|
|
});
|
|
|
|
// Скрыть разделы в меню
|
|
Lampa.Listener.follow('app', (e) => {
|
|
if (e.type === 'ready') {
|
|
$("[data-action=feed]").hide(); // лента
|
|
$("[data-action=myperson]").hide(); // cub подписка на актеров
|
|
$("[data-action=subscribes]").hide();
|
|
$("[data-action=mytorrents]").hide();
|
|
$("[data-action=about]").hide();
|
|
$("[data-action=console]").hide();
|
|
$("[data-action=timetable]").hide();
|
|
$("[data-action=anime]").hide();
|
|
}
|
|
});
|
|
}
|
|
})(); |