Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nb557 committed Dec 6, 2023
1 parent 9c31a99 commit 4ad8e78
Showing 1 changed file with 73 additions and 42 deletions.
115 changes: 73 additions & 42 deletions online_mod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//03.12.2023 - Update
//07.12.2023 - Update

(function () {
'use strict';
Expand Down Expand Up @@ -3525,8 +3525,8 @@
});
}

if (!window.filmix) {
window.filmix = {
if (!window.mod_filmix) {
window.mod_filmix = {
max_qualitie: 720,
is_max_qualitie: false
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -14943,6 +14944,13 @@
}

Lampa.Lang.add({
online_mod_watch: {
ru: 'Смотреть онлайн',
uk: 'Дивитися онлайн',
be: 'Глядзець анлайн',
en: 'Watch online',
zh: '在线观看'
},
online_mod_nolink: {
ru: 'Не удалось извлечь ссылку',
uk: 'Неможливо отримати посилання',
Expand Down Expand Up @@ -15273,53 +15281,76 @@
zh: '发生了错误'
}
});
var network = new Lampa.Reguest();
var online_loading = false;

function resetTemplates() {
Lampa.Template.add('online_mod', "<div class=\"online selector\">\n <div class=\"online__body\">\n <div style=\"position: absolute;left: 0;top: -0.3em;width: 2.4em;height: 2.4em\">\n <svg style=\"height: 2.4em; width: 2.4em;\" viewBox=\"0 0 128 128\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"64\" cy=\"64\" r=\"56\" stroke=\"white\" stroke-width=\"16\"/>\n <path d=\"M90.5 64.3827L50 87.7654L50 41L90.5 64.3827Z\" fill=\"white\"/>\n </svg>\n </div>\n <div class=\"online__title\" style=\"padding-left: 2.1em;\">{title}</div>\n <div class=\"online__quality\" style=\"padding-left: 3.4em;\">{quality}{info}</div>\n </div>\n </div>");
Lampa.Template.add('online_mod_folder', "<div class=\"online selector\">\n <div class=\"online__body\">\n <div style=\"position: absolute;left: 0;top: -0.3em;width: 2.4em;height: 2.4em\">\n <svg style=\"height: 2.4em; width: 2.4em;\" viewBox=\"0 0 128 112\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"20\" width=\"128\" height=\"92\" rx=\"13\" fill=\"white\"/>\n <path d=\"M29.9963 8H98.0037C96.0446 3.3021 91.4079 0 86 0H42C36.5921 0 31.9555 3.3021 29.9963 8Z\" fill=\"white\" fill-opacity=\"0.23\"/>\n <rect x=\"11\" y=\"8\" width=\"106\" height=\"76\" rx=\"13\" fill=\"white\" fill-opacity=\"0.51\"/>\n </svg>\n </div>\n <div class=\"online__title\" style=\"padding-left: 2.1em;\">{title}</div>\n <div class=\"online__quality\" style=\"padding-left: 3.4em;\">{quality}{info}</div>\n </div>\n </div>");
}

var button = "<div class=\"full-start__button selector view--online_mod\" data-subtitle=\"online_mod 03.12.2023\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:svgjs=\"http://svgjs.com/svgjs\" version=\"1.1\" width=\"512\" height=\"512\" x=\"0\" y=\"0\" viewBox=\"0 0 244 260\" style=\"enable-background:new 0 0 512 512\" xml:space=\"preserve\" class=\"\">\n <g xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M242,88v170H10V88h41l-38,38h37.1l38-38h38.4l-38,38h38.4l38-38h38.3l-38,38H204L242,88L242,88z M228.9,2l8,37.7l0,0 L191.2,10L228.9,2z M160.6,56l-45.8-29.7l38-8.1l45.8,29.7L160.6,56z M84.5,72.1L38.8,42.4l38-8.1l45.8,29.7L84.5,72.1z M10,88 L2,50.2L47.8,80L10,88z\" fill=\"currentColor\"/>\n </g></svg>\n\n <span>#{online_mod_title}</span>\n </div>"; // нужна заглушка, а то при страте лампы говорит пусто
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 = "<div class=\"full-start__button selector view--online_mod\" data-subtitle=\"online_mod " + mod_version + "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:svgjs=\"http://svgjs.com/svgjs\" version=\"1.1\" width=\"512\" height=\"512\" x=\"0\" y=\"0\" viewBox=\"0 0 244 260\" style=\"enable-background:new 0 0 512 512\" xml:space=\"preserve\" class=\"\">\n <g xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M242,88v170H10V88h41l-38,38h37.1l38-38h38.4l-38,38h38.4l38-38h38.3l-38,38H204L242,88L242,88z M228.9,2l8,37.7l0,0 L191.2,10L228.9,2z M160.6,56l-45.8-29.7l38-8.1l45.8,29.7L160.6,56z M84.5,72.1L38.8,42.4l38-8.1l45.8,29.7L84.5,72.1z M10,88 L2,50.2L47.8,80L10,88z\" fill=\"currentColor\"/>\n </g></svg>\n\n <span>#{online_mod_title}</span>\n </div>";
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);
}
Expand Down

0 comments on commit 4ad8e78

Please sign in to comment.