// ==UserScript== // @name Kinorium.com – Enhanced [Ath] // @name:ru Kinorium.com – Улучшенный [Ath] // @name:uk Kinorium.com – Покращений [Ath] // @name:be Kinorium.com – Удасканалены [Ath] // @name:bg Kinorium.com – Подобрен [Ath] // @name:tt Kinorium.com – Яхшыртылган [Ath] // @name:sl Kinorium.com – Izboljšan [Ath] // @name:sr Kinorium.com – Poboljšan [Ath] // @name:ka Kinorium.com – გაუმჯობესებული [Ath] // @description Kinorium.com enhancements: user collections usability, links to extra streaming providers, native lazy loading of images etc. // @description:ru Улучшения для Kinorium.com: удобство работы с пользовательскими коллекциями, ссылки на дополнительные онлайн-кинотеатры, нативная ленивая загрузка изображений и т.д. // @description:uk Покращення для Kinorium.com: зручність роботи з користувацькими колекціями, посилання на додаткові онлайн-кінотеатри, нативна лінива завантаження зображень тощо. // @description:be Удасканаленні для Kinorium.com: зручнасць працы з карыстальніцкімі калекцыямі, спасылкі на дадатковыя анлайн-кінатэатры, натыўная ленівая загрузка здымкаў і г.д. // @description:bg Подобрения за Kinorium.com: удобство при работата с потребителски колекции, връзки към допълнителни онлайн кинотеатри, нативно мързеливо зареждане на изображения и т.н. // @description:tt Kinorium.com өчен яхшыртулар: кулланучы коллекцияләре белән эш итү җиңеллеге, өстәмә онлайн-кинотеатрларга сылтамалар, туган ленивая загрузка изображений һ.б. // @description:sl Izboljšave za Kinorium.com: uporabnost uporabniških zbirk, povezave do dodatnih spletnih kinodvoran, domače leno nalaganje slik itd. // @description:sr Poboljšanja za Kinorium.com: upotrebljivost korisničkih kolekcija, linkovi ka dodatnim online bioskopima, nativno lenjo učitavanje slika itd. // @description:ka Kinorium.com-ის გაუმჯობესება: მომხმარებლის კოლექციების გამოყენების მარტივება, დამატებითი ონლაინ-კინოთეატრების ბმულები, ნატიური ზარმაცი იმიჯების ჩატვირთვა და სხვა. // @namespace athari // @author Athari (https://github.com/Athari) // @copyright © Prokhorov ‘Athari’ Alexander, 2024–2025 // @license MIT // @homepageURL https://github.com/Athari/AthariUserJS // @supportURL https://github.com/Athari/AthariUserJS/issues // @version 1.6.0 // @icon https://www.google.com/s2/favicons?sz=64&domain=kinorium.com // @match https://*.kinorium.com/* // @grant unsafeWindow // @grant GM_getValue // @grant GM_setValue // @grant GM_getResourceText // @grant GM_getResourceURL // @grant GM_info // @grant GM_registerMenuCommand // @run-at document-start // @require https://cdn.jsdelivr.net/npm/string@3.3.3/dist/string.min.js // @require https://cdn.jsdelivr.net/npm/@athari/monkeyutils@0.5.5/monkeyutils.u.min.js // @resource script-microdata https://cdn.jsdelivr.net/npm/@cucumber/microdata@2.1.0/dist/esm/src/index.min.js // @resource script-urlpattern https://cdn.jsdelivr.net/npm/urlpattern-polyfill/dist/urlpattern.js // @resource font-neucha-latin https://fonts.gstatic.com/s/neucha/v17/q5uGsou0JOdh94bfvQlt.woff2 // @resource img-cinema-default https://images.kinorium.com/web/vod/vod_channels.svg // @resource img-cinema-rezka https://rezka.ag/templates/hdrezka/images/hdrezka-logo.png // @resource img-cinema-mults https://mults.info/img/logo.png // @resource img-cinema-kinobox data:image/svg+xml;utf8, // @tag athari // @downloadURL https://update.greasyfork.icu/scripts/524042/Kinoriumcom%20%E2%80%93%20Enhanced%20%5BAth%5D.user.js // @updateURL https://update.greasyfork.icu/scripts/524042/Kinoriumcom%20%E2%80%93%20Enhanced%20%5BAth%5D.meta.js // ==/UserScript== (async () => { 'use strict' const { assignDeep, delay, waitForDocumentReady, h, u, f, utf8ToWin1251, toUrl, matchLocation, download, attempt, throwError, overrideProperty, overrideXmlHttpRequest, reviveConsole, wrapElement, ress, scripts, els, opts } = //require("../@athari-monkeyutils/monkeyutils.u"); // TODO athari.monkeyutils; const hostKinorium = "*\.kinorium\.com"; const res = ress(), script = scripts(res); const eld = doc => els(doc, { dlgCollections: ".collectionWrapper.collectionsWindow", collectionCaches: ".collection_cache", lstCollection: ".collectionList, .filmList, .statuses", athMovieUserList: ".ath-movie-ulist", lazyImages: "img[data-preload], img[src*='/img/blank'][style^='background:']", lstCinemaButtons: ".film-page__buttons-cinema", item: ".item", itemComment: ".statusText", itemInfo: ".info", statusWidget: ".statusWidget", athItemComment: ".ath-item-status", athItemCommentRating: ".ath-item-status-rating", lnkTrailer: ".trailers__list .trailers__link, .trailer.item.video", mnuUser: ".userMenu", lstSites: ".sites_page .sites", lnkSiteDataHref: ".sites_page .sites a[href='#']:is([data-original-url], [data-url])", btnDelSite: ".sites_page .sites .delReport", filmLeftPanel: ".film-page_leftContent", }), el = eld(document); const ctls = ctl => els(ctl, { ctlMovieItem: ".item.movie", ctlColItemSpan: "span:is(.title, .icon, .cnt)", ctlColItemIcon: ".collectionList span.icon", checkbox: "input[type=checkbox]", }); const opt = opts({ listUserCollections: true, iconifyUserCollections: true, addExtraCinemaSources: true, commentsBelowRatings: true, directLinksToTrailers: true, addExternalLinks: true, nativeLazyImages: true, }); const strs = { en: { listUserCollections: "List user collections", iconifyUserCollections: "Iconify user collections", addExtraCinemaSources: "Add extra cinema sources", nativeLazyImages: "Native lazy images", commentsBelowRatings: "Comments below ratings", directLinksToTrailers: "Direct links to videos", addExternalLinks: "External movie links in sidebar", watchMovieOn: "watch “%0%” on %1%", }, ru: { listUserCollections: "Список коллекций юзера", iconifyUserCollections: "Иконки у коллекций юзера", addExtraCinemaSources: "Дополнительные кинотеатры", nativeLazyImages: "Нативные ленивые картинки", commentsBelowRatings: "Комментарии под оценками", directLinksToTrailers: "Прямые ссылки на видео", addExternalLinks: "Внешние ссылки на фильм сбоку", watchMovieOn: "смотреть «%0%» на %1%", }, uk: { listUserCollections: "Список колекцій користувача", iconifyUserCollections: "Іконки у колекціях користувача", addExtraCinemaSources: "Додаткові кінотеатри", nativeLazyImages: "Нативні ліниві зображення", commentsBelowRatings: "Коментарі під оцінками", directLinksToTrailers: "Прямі посилання на відео", addExternalLinks: "Зовнішні посилання на фільм збоку", watchMovieOn: "дивитися «%0%» на %1%", }, }; const op = {}; const { log: consoleLog } = unsafeWindow.console; unsafeWindow.console.log = (...args) => args[0]?.includes?.("Не пиши парсер") ? throwError("fuck you") : consoleLog(...args); const consoleRevived = reviveConsole(unsafeWindow); overrideXmlHttpRequest(unsafeWindow, { on: { load: async (_, load) => { load?.(); await delay(0); if (!op.isInitialized) return; op.doCommentsBelowRatings(); op.doListUserCollections(); op.doNativeLazyImages(); }, }, }); await consoleRevived; S.extendPrototype(); Object.assign(globalThis, globalThis.URLPattern ? null : await script.urlpattern); console.debug("GM info", GM_info); //GM_registerMenuCommand("Config", e => alert(e), { accessKey: 'a', title: "Config Enhancer" }); //overrideProperty(unsafeWindow, 'loadedTimestamp', v => (v.setFullYear(3000), v)); console.log(await waitForDocumentReady()); const { USER_ID: userId, PRO: userPro } = unsafeWindow; const language = { ua: 'uk' }[unsafeWindow.LANGUAGE] ?? unsafeWindow.LANGUAGE; const str = strs[language] ?? strs.en; let murl = null; el.tag.head.insertAdjacentHTML('beforeEnd', /*html*/` `); (op.addOptionsMenu = () => attempt("add options menu", () => { const chks = []; const tplCheckbox = (id) => ( chks.push({ id }), /*html*/` `); const userScriptStr = (prop, def) => GM_info.script[`${prop}_i18n`]?.[language] ?? GM_info.script[prop] ?? def; el.mnuUser.insertAdjacentHTML('beforeEnd', /*html*/`