Skip to content

Instantly share code, notes, and snippets.

@yukkerike
Last active February 16, 2025 22:00
Show Gist options
  • Save yukkerike/b48754035375feb9cfdcc784388e13c6 to your computer and use it in GitHub Desktop.
Save yukkerike/b48754035375feb9cfdcc784388e13c6 to your computer and use it in GitHub Desktop.
Открыть фильм из базы кинопоиска на kinopoiskk.ru. Основано на https://github.com/Kirlovon/Kinopoisk-Watch. Установка: https://gist.githubusercontent.com/yukkerike/b48754035375feb9cfdcc784388e13c6/raw/kinopoiskws.user.js
// ==UserScript==
// @name Kinopoisk.ws
// @version 1.8
// @updateURL https://gist.githubusercontent.com/yukkerike/b48754035375feb9cfdcc784388e13c6/raw/kinopoiskws.user.js
// @downloadURL https://gist.githubusercontent.com/yukkerike/b48754035375feb9cfdcc784388e13c6/raw/kinopoiskws.user.js
// @run-at document-start
// @match *://*.kinopoisk.ru/film/*
// @match *://*.kinopoisk.ru/series/*
// @match *://*.kpfr.fun/film/*
// @match *://*.kpfr.fun/series/*
// @match *://*.kpfr.club/film/*
// @match *://*.kpfr.club/series/*
// ==/UserScript==
function mountBanner(id) {
var banner = document.createElement('div');
banner.innerHTML = '<svg viewBox="0 0 128 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M128 0H0v512l64-32 64 32V0z" fill="url(#_Linear1)"/><path d="M104 382c0-21.943-18.057-40-40-40s-40 18.057-40 40 18.057 40 40 40h37l3-12h-6l-2 4h-8a40.025 40.025 0 0016-32zm-72 0c0-17.555 14.445-32 32-32s32 14.445 32 32-14.445 32-32 32-32-14.445-32-32zm32 11c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8zm16-10c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8zm-32 0c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8zm32-18c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8zm-32 0c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8zm16-10c4.415 0 8 3.585 8 8s-3.585 8-8 8-8-3.585-8-8 3.585-8 8-8z" fill="rgb(235,255,255)" fill-rule="nonzero"/><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(128 512 -2048 512 0 0)"><stop offset="0" stop-color="rgb(248,12,101)"/><stop offset="1" stop-color="rgb(247,88,27)"/></linearGradient></defs></svg>';
banner.style = "width:32px;height:128px;left:8px;top:0;outline:none;cursor:pointer;position:fixed;z-index:3;";
document.body.appendChild(banner);
banner.addEventListener('click', function () {
window.open("http://www.kinopoisk.cx/series/" + id, '_blank').focus();
});
}
function init() {
if (!document.body) return;
clearInterval(stop);
var splitted = window.location.href.split('/');
if (splitted[2].indexOf('kinopoisk.ru') == -1)
stop = setInterval(replaceeverythingwithiframe, 0);
else
mountBanner(splitted[4]);
}
function replaceeverythingwithiframe() {
var iframe = document.getElementsByTagName('iframe')[0];
if (iframe.src == location.href) return;
clearInterval(stop);
document.body.innerHTML = "";
document.body.append(iframe);
var css = document.createElement('style');
css.innerHTML = "html,body{height:100%}";
document.head.appendChild(css);
}
var stop = setInterval(init, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment