From 4ad8e7847bfbe1221fa8748dadacae6e8299bef6 Mon Sep 17 00:00:00 2001 From: nb557 <> Date: Thu, 7 Dec 2023 01:03:34 +0300 Subject: [PATCH] Update --- online_mod.js | 115 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 42 deletions(-) diff --git a/online_mod.js b/online_mod.js index a0f97a2..9683b91 100644 --- a/online_mod.js +++ b/online_mod.js @@ -1,4 +1,4 @@ -//03.12.2023 - Update +//07.12.2023 - Update (function () { 'use strict'; @@ -3525,8 +3525,8 @@ }); } - if (!window.filmix) { - window.filmix = { + if (!window.mod_filmix) { + window.mod_filmix = { max_qualitie: 720, is_max_qualitie: false }; @@ -3641,14 +3641,14 @@ function find(filmix_id, abuse) { var url = embed; - if (!debug && !window.filmix.is_max_qualitie && token) { - window.filmix.is_max_qualitie = true; + if (!debug && !window.mod_filmix.is_max_qualitie && token) { + window.mod_filmix.is_max_qualitie = true; network.clear(); network.timeout(10000); network.silent(url + 'user_profile' + dev_token, function (found) { if (found && found.user_data) { - if (found.user_data.is_pro) window.filmix.max_qualitie = 1080; - if (found.user_data.is_pro_plus) window.filmix.max_qualitie = 2160; + if (found.user_data.is_pro) window.mod_filmix.max_qualitie = 1080; + if (found.user_data.is_pro_plus) window.mod_filmix.max_qualitie = 2160; } end_search(filmix_id); @@ -3759,7 +3759,7 @@ function extractData(data) { extract = {}; - var filmix_max_qualitie = debug ? 2160 : window.filmix.max_qualitie; + var filmix_max_qualitie = debug ? 2160 : window.mod_filmix.max_qualitie; var pl_links = data.player_links || {}; if (pl_links.playlist && Object.keys(pl_links.playlist).length > 0) { @@ -13308,7 +13308,7 @@ function hdvb(component, _object) { var network = new Lampa.Reguest(); var extract = []; - var backend = 'http://back.freebie.tom.ru/lampa/hdvburl?v=2311'; + var backend = 'http://back.freebie.tom.ru/lampa/hdvburl?v=2403'; var object = _object; var select_title = ''; var select_id = ''; @@ -14881,6 +14881,7 @@ }; } + var mod_version = '07.12.2023'; var isMSX = !!(window.TVXHost || window.TVXManager); var isTizen = navigator.userAgent.toLowerCase().indexOf('tizen') !== -1; var isIFrame = window.parent !== window; @@ -14943,6 +14944,13 @@ } Lampa.Lang.add({ + online_mod_watch: { + ru: 'Смотреть онлайн', + uk: 'Дивитися онлайн', + be: 'Глядзець анлайн', + en: 'Watch online', + zh: '在线观看' + }, online_mod_nolink: { ru: 'Не удалось извлечь ссылку', uk: 'Неможливо отримати посилання', @@ -15273,53 +15281,76 @@ zh: '发生了错误' } }); + var network = new Lampa.Reguest(); + var online_loading = false; function resetTemplates() { Lampa.Template.add('online_mod', "
\n
\n
\n \n \n \n \n
\n
{title}
\n
{quality}{info}
\n
\n
"); Lampa.Template.add('online_mod_folder', "
\n
\n
\n \n \n \n \n \n
\n
{title}
\n
{quality}{info}
\n
\n
"); } - var button = "
\n \n \n \n \n\n #{online_mod_title}\n
"; // нужна заглушка, а то при страте лампы говорит пусто + function loadOnline(object) { + var onComplite = function onComplite() { + online_loading = false; + resetTemplates(); + Lampa.Component.add('online_mod', component); + Lampa.Activity.push({ + url: '', + title: Lampa.Lang.translate('online_mod_title_full'), + component: 'online_mod', + search: object.title, + search_one: object.title, + search_two: object.original_title, + movie: object, + page: 1 + }); + }; + + Utils.setMyIp(''); + + if (Lampa.Storage.field('online_mod_proxy_find_ip') === true) { + if (online_loading) return; + online_loading = true; + network.clear(); + network.timeout(10000); + network.silent('https://api.ipify.org/?format=json', function (json) { + if (json.ip) Utils.setMyIp(json.ip); + onComplite(); + }, function (a, c) { + onComplite(); + }); + } else onComplite(); + } // нужна заглушка, а то при страте лампы говорит пусто + Lampa.Component.add('online_mod', component); //то же самое resetTemplates(); - var network = new Lampa.Reguest(); + var manifest = { + type: 'video', + version: mod_version, + name: Lampa.Lang.translate('online_mod_title_full') + ' - ' + mod_version, + description: Lampa.Lang.translate('online_mod_watch'), + component: 'online_mod', + onContextMenu: function onContextMenu(object) { + return { + name: Lampa.Lang.translate('online_mod_watch'), + description: '' + }; + }, + onContextLauch: function onContextLauch(object) { + online_loading = false; + loadOnline(object); + } + }; + Lampa.Manifest.plugins = manifest; + var button = "
\n \n \n \n \n\n #{online_mod_title}\n
"; Lampa.Listener.follow('full', function (e) { if (e.type == 'complite') { var btn = $(Lampa.Lang.translate(button)); - var loading = false; + online_loading = false; btn.on('hover:enter', function () { - var onComplite = function onComplite() { - loading = false; - resetTemplates(); - Lampa.Component.add('online_mod', component); - Lampa.Activity.push({ - url: '', - title: Lampa.Lang.translate('online_mod_title_full'), - component: 'online_mod', - search: e.data.movie.title, - search_one: e.data.movie.title, - search_two: e.data.movie.original_title, - movie: e.data.movie, - page: 1 - }); - }; - - Utils.setMyIp(''); - - if (Lampa.Storage.field('online_mod_proxy_find_ip') === true) { - if (loading) return; - loading = true; - network.clear(); - network.timeout(10000); - network.silent('https://api.ipify.org/?format=json', function (json) { - if (json.ip) Utils.setMyIp(json.ip); - onComplite(); - }, function (a, c) { - onComplite(); - }); - } else onComplite(); + loadOnline(e.data.movie); }); e.object.activity.render().find('.view--torrent').after(btn); }