// ==UserScript== // @name KinoFree // @namespace kinofree // @version 0.2.1 // @description Бесплатный доступ к фильмам и сериалам КиноПоиска // @author DenCoder // @match *://www.kinopoisk.ru/*/* // @grant none // ==/UserScript== // original name: Kinopoisk-Watch // original author: Kirlovon // original repo: https://github.com/Kirlovon/Kinopoisk-Watch // Link to the viewer page const kinopoiskWatchLink = 'https://4h0y.gitlab.io/#'; // Image of the banner const bannerImage = ` `; // Get id, type & title of current movie function getMovieData() { const url = window.location.href; const splitted = url.split('/'); const id = splitted[4]; const type = splitted[3]; const title = document.querySelector('meta[property="og:title"]')?.content; return { id, type, title }; } // Open page with Yohoho player function openPlayer(id) { window.open(kinopoiskWatchLink + id, '_blank').focus(); } // Mount KinoFree banner to the page function mountBanner(id, title) { const banner = document.createElement('div'); banner.id = 'kinofree'; banner.innerHTML = bannerImage; banner.style.width = '32px'; banner.style.height = '128px'; banner.style.top = '-128px'; banner.style.left = '8px'; banner.style.outline = 'none'; banner.style.cursor = 'pointer'; banner.style.position = 'fixed'; banner.style.zIndex = '9999999999'; banner.style.transition = 'top 0.2s ease'; setTimeout(() => { banner.style.top = '-32px'; banner.addEventListener('click', () => openPlayer(id, title)); banner.addEventListener('mouseover', () => { banner.style.top = '0px' }); banner.addEventListener('mouseout', () => { banner.style.top = '-32px' }); }, 100); document.body.appendChild(banner); } // Initialize script function init() { const { id, type, title } = getMovieData(); if (type === 'film' || type === 'series') mountBanner(id, title); } // Init on load window.addEventListener('load', init);