Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nb557 committed Nov 9, 2023
1 parent 25a13d9 commit 7cb3f2f
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions online_mod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//07.11.2023 - Add alloha
//09.11.2023 - Add alloha

(function () {
'use strict';
Expand Down Expand Up @@ -3192,11 +3192,26 @@
season: [],
voice: []
};
var season_objs = [];
extract.forEach(function (s) {
if (s.folder) filter_items.season.push(s.title || s.comment || '');
if (s.folder) {
s.title = s.title || s.comment || '';
s.season_num = parseInt(s.title.match(/\d+/));
season_objs.push(s);
}
});
season_objs.sort(function (a, b) {
var cmp = a.season_num - b.season_num;
if (cmp) return cmp;
if (a.title > b.title) return 1;
if (a.title < b.title) return -1;
return 0;
});
filter_items.season = season_objs.map(function (s) {
return s.title;
});
if (!filter_items.season[choice.season]) choice.season = 0;
var s = extract[choice.season];
var s = season_objs[choice.season];

if (s && s.folder) {
s.folder.forEach(function (e) {
Expand Down Expand Up @@ -3410,7 +3425,7 @@
return;
}

if (secret_part) secret = '.com/s/' + secret_part + Lampa.Utils.uid(3) + '/';
if (secret_part) secret = '$1/s/' + secret_part + Lampa.Utils.uid(3) + '/';
var timestamp = new Date().getTime();
var cache_timestamp = timestamp - 1000 * 60 * 10;

Expand All @@ -3432,7 +3447,7 @@
network.silent(url, function (str) {
if (str) {
secret_part = str;
secret = '.com/s/' + secret_part + Lampa.Utils.uid(3) + '/';
secret = '$1/s/' + secret_part + Lampa.Utils.uid(3) + '/';
secret_url = '';
secret_timestamp = timestamp;
}
Expand Down Expand Up @@ -3655,11 +3670,11 @@
var stream_url = file.link || '';

if (file.translation === 'Заблокировано правообладателем!' && stream_url.indexOf('/abuse_') !== -1) {
var found = stream_url.match(/(\.com\/s\/[^\/]*\/)/);
var found = stream_url.match(/https?:\/\/[^\/]+(\/s\/[^\/]*\/)/);

if (found) {
if (!secret_part) {
secret = found[1];
secret = '$1' + found[1];
secret_url = '';
}

Expand Down Expand Up @@ -3712,7 +3727,7 @@
if (prefer_http) stream_url = stream_url.replace('https://', 'http://');

if (secret) {
stream_url = stream_url.replace(/\.com\/s\/[^\/]*\//, secret);
stream_url = stream_url.replace(/(https?:\/\/[^\/]+)\/s\/[^\/]*\//, secret);
if (secret_url) stream_url = stream_url.replace(/^https?:\/\//, secret_url);
}

Expand Down Expand Up @@ -3771,7 +3786,7 @@
if (prefer_http) _stream_url = _stream_url.replace('https://', 'http://');

if (secret) {
_stream_url = _stream_url.replace(/\.com\/s\/[^\/]*\//, secret);
_stream_url = _stream_url.replace(/(https?:\/\/[^\/]+)\/s\/[^\/]*\//, secret);
if (secret_url) _stream_url = _stream_url.replace(/^https?:\/\//, secret_url);
}

Expand Down Expand Up @@ -15510,7 +15525,7 @@
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 07.11.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>"; // нужна заглушка, а то при страте лампы говорит пусто
var button = "<div class=\"full-start__button selector view--online_mod\" data-subtitle=\"online_mod 09.11.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>"; // нужна заглушка, а то при страте лампы говорит пусто

Lampa.Component.add('online_mod', component); //то же самое

Expand Down

0 comments on commit 7cb3f2f

Please sign in to comment.