Free javascript Hosting


online2.js

Uploaded on Nov 30 2021 18:22 by pipon

!(function () {
"use strict";
var e = new Lampa.Reguest(),
t = {},
i = {},
token = '3i40G5TSECmLF77oAqnEgbx61ZWaOYaE';
function n(e, t) {
var i = "";
try {
var n = e.split(",").map(function (e) {
return { quality: parseInt(e.match(/\[(\d+)p\]/)[1]), file: e.replace(/\[\d+p\]/, "").split(" or ")[0] };
});
n.sort(function (e, t) {
return t.quality - e.quality;
}),
(i = "http:" + (i = n[0].file).slice(0, i.lastIndexOf("/")) + "/" + (t || n[0].quality) + ".mp4");
} catch (e) {}
return i;
}
function a(e, t, n) {
var a = i[e.translation],
o = e.season + "_" + e.episode,
s = "";
if (a)
if (e.season)
for (var r in a.json) {
var l = a.json[r];
if (l.folder)
for (var c in l.folder) {
var d = l.folder[c];
if (d.id === o) {
s = d.file;
break;
}
}
else if (l.id === o) {
s = l.file;
break;
}
}
else s = a.file;
return (t = parseInt(t)), s ? s.split("/").pop().replace(".mp4", "") !== t && (s = s.slice(0, s.lastIndexOf("/")) + "/" + t + ".mp4") : n && Lampa.Noty.show("Не удалось извлечь ссылку"), s;
}
var o = {
search: function (a, o, s, r, l) {
t = a;
var c = o[0].iframe_src,
d = "https://videocdn.tv/api/" + (-1 !== c.indexOf("/tv-series/") ? "tv-series" : -1 !== c.indexOf("/anime/") ? "animes" : -1 !== c.indexOf("/anime-tv-series/") ? "anime-tv-series" : "movies");
d = Lampa.Utils.addUrlComponent(d, 'api_token=' + token);
o[0].kp_id
? ((d = Lampa.Utils.addUrlComponent(d, "field=kinopoisk_id")), (d = Lampa.Utils.addUrlComponent(d, "query=" + encodeURIComponent(o[0].kp_id))))
: ((d = Lampa.Utils.addUrlComponent(d, "title=" + encodeURIComponent(t.search))),
t.movie.release_date && "0000" !== t.movie.release_date && (d = Lampa.Utils.addUrlComponent(d, "year=" + (t.movie.release_date + "").slice(0, 4)))),
(d = Lampa.Utils.addUrlComponent(d, "limit=1")),
e.silent(
d,
function (t) {
t.data && t.data.length
? (s(t.data),
(function (t) {
e.timeout(5e3);
var a = t.slice(0, 1)[0];
if (((i = {}), a)) {
var o = a.iframe_src;
e.silent(
"http:" + o,
function (e) {
var t = e.replace(/\n/g, "").match(/id="files" value="(.*?)"/);
if (t) {
var o = Lampa.Arrays.decodeJson(t[1].replace(/"/g, '"'), {}),
s = document.createElement("textarea"),
r = function (e) {
var t, r;
if (0 == e - 0) return "continue";
(s.innerHTML = o[e]), Lampa.Arrays.decodeJson(s.value, {});
var l,
c,
d =
null === (t = a.media) ||
void 0 === t ||
null ===
(r = t.filter(function (t) {
return t.translation_id === e - 0;
})[0]) ||
void 0 === r
? void 0
: r.max_quality;
d ||
(d =
null === (l = a.translations) ||
void 0 === l ||
null ===
(c = l.filter(function (t) {
return t.id === e - 0;
})[0]) ||
void 0 === c
? void 0
: c.max_quality);
for (var p in ((i[e] = { json: Lampa.Arrays.decodeJson(s.value, {}), file: n(o[e], d) }), i[e].json)) {
var u = i[e].json[p];
if (u.folder)
for (var f in u.folder) {
var v = u.folder[f];
v.file = n(v.file, d);
}
else u.file = n(u.file, d);
}
};
for (var l in o) r(l);
}
},
!1,
!1,
{ dataType: "text" }
);
}
})(t.data))
: r();
},
function (t, i) {
r(e.errorDecode(t, i));
}
);
},
filter: function (e) {
var t = e.filter_items,
i = e.select_season;
e.results.slice(0, 1).forEach(function (e) {
if (e.season_count) {
for (var n = e.season_count; n--; ) t.season.push("Сезон " + (e.season_count - n));
t.choice.season = void 0 === i ? t.season.length - e.season_count : i;
}
t.season.length
? e.episodes.forEach(function (e) {
e.season_num == t.choice.season + 1 &&
e.media.forEach(function (e) {
-1 == t.voice.indexOf(e.translation.title) && (t.voice.push(e.translation.title), t.voice_info.push({ id: e.translation.id }));
});
})
: e.translations.forEach(function (e) {
t.voice.push(e.title), t.voice_info.push({ id: e.id });
});
});
},
filtred: function (e, i) {
var n = [],
a = Lampa.Storage.get("online_filter", "{}");
return (
t.movie.number_of_seasons
? (e.slice(0, 1).forEach(function (e) {
e.episodes.forEach(function (e) {
e.season_num == a.season + 1 &&
e.media.forEach(function (t) {
(-1 !== a.voice && t.translation.id != i.voice_info[a.voice].id) ||
n.push({ episode: parseInt(e.num), season: e.season_num, title: e.num + " - " + e.ru_title, quality: t.max_quality + "p / " + t.translation.title, translation: t.translation_id });
});
});
}),
n.sort(function (e, t) {
return e.translation - t.translation;
}))
: e.slice(0, 1).forEach(function (e) {
e.media.forEach(function (e) {
(-1 !== a.voice && e.translation.id !== i.voice_info[a.voice].id) || n.push({ title: e.translation.title, quality: e.max_quality + "p", translation: e.translation_id });
});
}),
n
);
},
append: function (e) {
e.items.forEach(function (i) {
var n = Lampa.Utils.hash(i.season ? [i.season, i.episode, t.movie.original_name].join("") : t.movie.original_title),
o = Lampa.Timeline.view(n),
s = Lampa.Template.get("online_vod", i);
(i.timeline = o),
s.append(Lampa.Timeline.render(o)),
s.on("hover:enter", function () {
t.movie.id && Lampa.Favorite.add("history", t.movie, 100);
var n = a(i, i.quality, !0),
s = Lampa.Storage.field("playlist_next");
if (n) {
e.open();
var r = [],
l = { url: n, timeline: o, title: i.season ? i.title : t.movie.title + " / " + i.title };
//Lampa.Player.play(r),
i.season && s
? e.items.forEach(function (e) {
e.translation === i.translation && r.push({ title: e.title, url: a(e, e.quality), timeline: e.timeline });
})
: r.push(l), "android" === Lampa.Storage.field("player")
? (r.length > 1 && (l.playlist = r), Lampa.Player.play(l))
: (Lampa.Player.play(l), Lampa.Player.playlist(r))
//Lampa.Player.playlist(s);
}
}),
e.item(s),
e.scroll.append(s);
});
},
},
s = new Lampa.Reguest(),
r = {};
var l = {
search: function (e, t, i, n, a) {
r = e;
var o = t[0].kp_id;
s.timeout(1e4),
s.silent(
"https://voidboost.net/embed/" + o,
function (e) {
for (var t, n = [], a = /data-token="([^"]+)"[^>]+>([^<]+)</g; null !== (t = a.exec(e)); ) {
t.index === a.lastIndex && a.lastIndex++;
var o = t[2],
s = t[1];
if (r.movie.number_of_seasons) {
var l = e.match(" seasons_episodes = ([^;]+)"),
c = JSON.parse(l[1]);
for (var d in c) {
var p = c[d];
for (var u in p) {
var f = p[u];
n.push({ title: o, season: parseInt(d, 10), episode: f, file: "https://voidboost.net/serial/" + s + "/iframe?s=" + d + "&e=" + f + "&h=voidboost.net", quality: "Auto " + o, voice_id: s });
}
}
} else n.push({ title: o, file: "https://voidboost.net/movie/" + s + "/iframe?h=gidonline.io", quality: "Auto", voice_id: s });
}
i(n);
},
n,
!1,
{ dataType: "text" }
);
},
filter: function (e) {
var t = e.filter_items,
i = e.select_season;
e.results.forEach(function (e) {
e.season && -1 === t.season.indexOf("Сезон " + e.season) && (t.season.push("Сезон " + e.season), (t.choice.season = void 0 === i ? t.season.length - e.season : i)),
t.season.length ? e.season === t.choice.season + 1 && -1 === t.voice.indexOf(e.title) && (t.voice.push(e.title), t.voice_info.push({ id: e.voice_id })) : (t.voice.push(e.title), t.voice_info.push({ id: e.voice_id }));
});
},
filtred: function (e, t) {
var i = [],
n = Lampa.Storage.get("online_filter", "{}");
return (
r.movie.number_of_seasons
? e.forEach(function (e) {
e.season == n.season + 1 &&
((-1 !== n.voice && e.voice_id != t.voice_info[n.voice].id) || i.push({ episode: e.episode, season: e.season, title: e.episode + " - Эпизод", quality: e.quality, translation: e.voice_id, file: e.file }));
})
: e.forEach(function (e) {
(-1 !== n.voice && e.voice_id !== t.voice_info[n.voice].id) || i.push({ title: e.title, quality: e.quality, translation: e.voice_id, file: e.file });
}),
i
);
},
append: function (e) {
e.items.forEach(function (t) {
var i = Lampa.Utils.hash(t.season ? [t.season, t.episode, r.movie.original_name].join("") : r.movie.original_title),
n = Lampa.Timeline.view(i),
a = Lampa.Template.get("online_vod", t);
a.append(Lampa.Timeline.render(n)),
a.on("hover:enter", function () {
r.movie.id && Lampa.Favorite.add("history", r.movie, 100),
(function (e, t, i) {
s.timeout(3e3),
s.silent(
e.file,
function (e) {
var n = e.match("file': '([^']+)'");
if (n) {
var a = n[0].match("2160p](.+?)mp4"),
o = n[0].match("1440p](.+?)mp4"),
s = n[0].match("1080p\\](.+?)mp4"),
r = n[0].match("720p\\](.+?)mp4"),
r480 = n[0].match("480p\\](.+?)mp4"),
r360 = n[0].match("360p\\](.+?)mp4");
a ? t(a[1] + "mp4") : o ? t(o[1] + "mp4") : s ? t(s[1] + "mp4") : r ? t(r[1] + "mp4") : r480 ? t(r480[1] + "mp4") : r360 ? t(r360[1] + "mp4") : i() //wtf i()?
} else i();
},
i,
!1,
{ dataType: "text" }
);
})(
t,
function (i) {
e.open();
var a = [],
o = { url: i, timeline: n, title: t.season ? t.title : r.movie.title + " / " + t.title };
Lampa.Player.play(o), a.push(o), Lampa.Player.playlist(a);
},
null
);
}),
e.item(a),
e.scroll.append(a);
});
},
};
function c(e) {
var t,
i,
n = { videocdn: o, rezka: l },
a = new Lampa.Reguest(),
s = new Lampa.Scroll({ mask: !0, over: !0 }),
r = new Lampa.Files(e),
c = new Lampa.Filter(e),
d = [],
p = [],
u = Lampa.Storage.get("online_balanser", "rezka"),
f = { season: [], voice: [], voice_info: [], choice: {} },
v = { season: "Сезон", voice: "Перевод" };
s.minus(),
s.body().addClass("torrent-list"),
(this.create = function () {
var t = this;
return (
this.activity.loader(!0),
Lampa.Background.immediately(Lampa.Utils.cardImgBackground(e.movie)),
(c.onSearch = function (e) {
Lampa.Activity.replace({ search: e, clarification: !0 });
}),
(c.onBack = function () {
t.start();
}),
this.balanser(),
c
.render()
.find(".selector")
.on("hover:focus", function (e) {
i = e.target;
}),
c.render().find(".filter--sort").remove(),
this.search(),
this.render()
);
}),
(this.balanser = function () {
var e = this,
t = $('<div class="simple-button simple-button--filter selector"><span>Источник</span><div>' + u + "</div></div>");
t.on("hover:enter", function () {
Lampa.Select.show({
title: "Источник",
items: [
{ title: "VideoCDN", source: "videocdn", selected: "videocdn" == u },
{ title: "HDRezka", source: "rezka", selected: "rezka" == u },
],
onBack: e.start,
onSelect: function (i) {
s.render().find(".online,.empty").remove(), (u = i.source), Lampa.Storage.set("online_balanser", i.source), t.find("div").text(i.source), e.search(), e.start();
},
});
}),
c.render().append(t);
}),
(this.search = function () { //Это все надо переписать
var t = this;
this.activity.loader(!0);
if (e.movie.id && !e.movie.imdb_id) //Карточка из tmdb или куба и нет imdb_id
{
var urltm="http://api.themoviedb.org/3/tv/"+e.movie.id+"/external_ids?api_key=4ef0d7355d9ffb5151e987764708ce96&language=ru";
a.silent(
urltm,
function (json) {
if (json && json.imdb_id) { //если tmdb знает imdb_id

e.movie.imdb_id=json.imdb_id;

var i = "https://videocdn.tv/api/short";
(i = e.movie.imdb_id ? Lampa.Utils.addUrlComponent(i, "imdb_id=" + encodeURIComponent(e.movie.imdb_id)) : Lampa.Utils.addUrlComponent(i, "title=" + encodeURIComponent(e.search))),
a.silent(
Lampa.Utils.addUrlComponent(i, 'api_token=' + token),
function (i) {
i.data && i.data.length
? n[u].search(
e,
i.data,
function (e) {
(d = e), t.build(), t.activity.loader(!1), t.activity.toggle();
},
function () {
t.empty("Произошла ошибки при получении информации от " + u + " (" + e.search + ")");
}
)
: t.empty("Ой, мы не нашли (" + e.search + ")");
},
function (e, i) {
t.empty("Ответ: [" + e.status + "]" + a.errorDecode(e, i));
}
);
}

else

{var i = "https://videocdn.tv/api/short";
(i = e.movie.imdb_id ? Lampa.Utils.addUrlComponent(i, "imdb_id=" + encodeURIComponent(e.movie.imdb_id)) : Lampa.Utils.addUrlComponent(i, "title=" + encodeURIComponent(e.search))),
a.silent(
Lampa.Utils.addUrlComponent(i, 'api_token=' + token),
function (i) {
i.data && i.data.length
? n[u].search(
e,
i.data,
function (e) {
(d = e), t.build(), t.activity.loader(!1), t.activity.toggle();
},
function () {
t.empty("Произошла ошибки при получении информации от " + u + " (" + e.search + ")");
}
)
: t.empty("Ой, мы не нашли (" + e.search + ")");
},
function (e, i) {
t.empty("Ответ: [" + e.status + "]" + a.errorDecode(e, i));
}
);
};

//t.empty("Ой, мы не нашли (" + e.search + ")");
},
function (e, i) {
t.empty("Ответ: [" + e.status + "]" + a.errorDecode(e, i));
}
);


}//e.movie.id
else //если нет tmdb или есть imdb_id

{var i = "https://videocdn.tv/api/short";
(i = e.movie.imdb_id ? Lampa.Utils.addUrlComponent(i, "imdb_id=" + encodeURIComponent(e.movie.imdb_id)) : Lampa.Utils.addUrlComponent(i, "title=" + encodeURIComponent(e.search))),
a.silent(
Lampa.Utils.addUrlComponent(i, 'api_token=' + token),
function (i) {
i.data && i.data.length
? n[u].search(
e,
i.data,
function (e) {
(d = e), t.build(), t.activity.loader(!1), t.activity.toggle();
},
function () {
t.empty("Произошла ошибки при получении информации от " + u + " (" + e.search + ")");
}
)
: t.empty("Ой, мы не нашли (" + e.search + ")");
},
function (e, i) {
t.empty("Ответ: [" + e.status + "]" + a.errorDecode(e, i));
}
);
};



}
),
(this.empty = function (e) {
var t = new Lampa.Empty({ descr: e });
r.render().find(".scroll__content").length ? (this.listEmpty(), this.start()) : (r.append(t.render(c.empty())), (this.start = t.start)), this.activity.loader(!1), this.activity.toggle();
}),
(this.buildFilter = function (t) {
var i = [],
a = function (e, t) {
var n = Lampa.Storage.get("online_filter", "{}"),
a = f[e],
o = [],
s = n[e];
a.forEach(function (e, t) {
o.push({ title: e, selected: s == t, index: t });
}),
i.push({ title: t, subtitle: a[s], items: o, stype: e });
};
(f.voice = []),
(f.season = []),
(f.voice_info = []),
(f.choice = { season: 0, voice: -1 }),
n[u].filter({ results: d, filter_items: f, select_season: t }),
Lampa.Storage.set("online_filter", e.movie ? f.choice : {}),
i.push({ title: "Сбросить фильтр", reset: !0 }),
e.movie && (a("voice", "Перевод"), e.movie.number_of_seasons && a("season", "Сезон")),
c.set("filter", i),
this.selectedFilter();
}),
(this.selectedFilter = function () {
var e = Lampa.Storage.get("online_filter", "{}"),
t = [];
for (var i in e) "voice" == i ? e[i] >= 0 && t.push(v[i] + ": " + f[i][e[i]]) : "season" == i && f.season.length >= 1 && t.push(v.season + ": " + f[i][e[i]]);
c.chosen("filter", t);
}),
(this.build = function () {
var e = this;
this.buildFilter(),
this.filtred(),
(c.onSelect = function (t, i, n) {
if ("filter" == t)
if (i.reset) e.buildFilter();
else if ("season" == i.stype) e.buildFilter(n.index);
else {
var a = Lampa.Storage.get("online_filter", "{}");
(a[i.stype] = n.index), (i.subtitle = n.title), Lampa.Storage.set("online_filter", a);
}
e.applyFilter(), e.start();
}),
this.showResults();
}),
(this.filtred = function () {
p = n[u].filtred(d, f);
}),
(this.applyFilter = function () {
this.filtred(), this.selectedFilter(), this.reset(), this.showResults(), (t = s.render().find(".torrent-item:eq(0)")[0]);
}),
(this.showResults = function () {
c.render().addClass("torrent-filter"), s.append(c.render()), p.length ? this.append(p) : this.listEmpty(), r.append(s.render());
}),
(this.reset = function () {
(t = !1), s.render().find(".empty").remove(), c.render().detach(), s.clear();
}),
(this.listEmpty = function () {
s.append(Lampa.Template.get("list_empty"));
}),
(this.append = function (e) {
n[u].append({
scroll: s,
items: e,
open: this.start.bind(this),
item: function (e) {
e.on("hover:focus", function (e) {
(t = e.target), s.update($(e.target), !0);
});
},
});
}),
(this.back = function () {
Lampa.Activity.backward();
}),
(this.start = function () {
Lampa.Controller.add("content", {
toggle: function () {
Lampa.Controller.collectionSet(s.render(), r.render()), Lampa.Controller.collectionFocus(t || !1, s.render());
},
up: function () {
Navigator.canmove("up") ? (0 == s.render().find(".selector").slice(3).index(t) && i ? Lampa.Controller.collectionFocus(i, s.render()) : Navigator.move("up")) : Lampa.Controller.toggle("head");
},
down: function () {
Navigator.move("down");
},
right: function () {
Navigator.move("right");
},
left: function () {
Navigator.canmove("left") ? Navigator.move("left") : Lampa.Controller.toggle("menu");
},
back: this.back,
}),
Lampa.Controller.toggle("content");
}),
(this.pause = function () {}),
(this.stop = function () {}),
(this.render = function () {
return r.render();
}),
(this.destroy = function () {
a.clear(), r.destroy(), s.destroy(), (d = null), (a = null);
});
}
window.plugin_vodmod_ready ||
((window.plugin_vodmod_ready = !0),
Lampa.Component.add("vodmod_android", c),
Lampa.Template.add(
"button_vod",
'<div class="full-start__button selector view--online">\n <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 122.88" style="enable-background:new 0 0 122.88 122.88" xml:space="preserve">\n <style type="text/css">\n .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#262829;}\n .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}\n </style><g><path class="st0" d="M61.44,0c33.93,0,61.44,27.51,61.44,61.44s-27.51,61.44-61.44,61.44S0,95.37,0,61.44S27.51,0,61.44,0L61.44,0 L61.44,0z"/><path class="st1" d="M84.32,65.41c3.31-2.13,3.3-4.51,0-6.4L50.13,39.36c-2.7-1.69-5.51-0.7-5.43,2.82l0.11,39.7 c0.23,3.82,2.41,4.86,5.62,3.1L84.32,65.41L84.32,65.41L84.32,65.41z"/></g></svg>\n\n <span>VOD</span>\n </div>'
),
Lampa.Template.add(
"online_vod",
'<div class="online selector">\n <div class="online__body">\n <div class="online__title">{title}</div>\n <div class="online__quality">{quality}</div>\n </div>\n </div>'
),
Lampa.Listener.follow("full", function (e) {
if ("complite" === e.type) {
var t = Lampa.Template.get("button_vod");
t.on("hover:enter", function () {
Lampa.Activity.push({ url: "", title: "VOD", component: "vodmod_android", search: e.data.movie.title, search_one: e.data.movie.title, search_two: e.data.movie.original_title, movie: e.data.movie, page: 1 });
}),
e.object.activity.render().find(".view--torrent").after(t);
}
}));
})();

Back to list