// ==UserScript==
// @name Kinopoisk+
// @namespace https://greasyfork.org/en/users/899-lain-inverse
// @description Adds links to torrent and other search engintes under movie poster
// @include https://kinopoisk.ru/film/*
// @include https://www.kinopoisk.ru/film/*
// @version 2.0
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @downloadURL none
// ==/UserScript==
// Script based on script with the same name by https://greasyfork.org/users/3348-xant1k
// Updated to load favicons even with CSP and create link to imdb.com without omdbapi.com which now requires API key
(function(){
'use strict';
let $ = unsafeWindow.$;
if (!$)
throw 'Unable to locate jQuery!';
let imgs_y = "https://favicon.yandex.net/favicon/";
let imgs_g = "https://plus.google.com/_/favicon?domain=";
let movie_eng = $("span[itemprop='alternativeHeadline']");
let movie = '';
if (movie_eng.text() != "") {
movie = movie_eng.text()
} else {
let movie_rus = $(".moviename-big[itemprop='name']");
let newLbl = $(movie_rus[0].outerHTML);
$("span", newLbl).remove();
movie = newLbl.text();
}
let movie_enc = encodeURIComponent(movie);
let year = $(".info a").html();
let links = [
'http://rutracker.org/forum/tracker.php?nm=',
'http://kinozal.tv/browse.php?s=',
'http://rutor.org/search/',
'http://nnm-club.me/forum/tracker.php?nm=',
'http://hdtracker.org/browse.php?search=',
'http://hdclub.org/browse.php?search=',
'https://broadcasthe.net/torrents.php?searchstr=',
'http://www.youtube.com/results?search_query=',
'http://hdwing.com/browse.php?search=',
'http://chdbits.org/torrents.php?search=',
'https://hdbits.org/browse.php?search=',
'http://cinemageddon.net/browse.php?search=',
'https://karagarga.net/browse.php?search=',
'http://www.bitmetv.org/browse.php?search=',
'http://www.allmovie.com/search/movies/',
'http://cinematik.net/browse.php?search=',
'https://tls.passthepopcorn.me/torrents.php?searchstr=',
'http://x264.me/browse.php?search=',
'http://asiandvdclub.org/browse.php?search=',
'https://www.hd-spain.com/browse.php?',
'https://scenehd.org/browse.php?search=',
'https://www.bit-hdtv.com/torrents.php?search=',
'https://awesome-hd.net/torrents.php?searchstr=',
'https://www.imdb.com/search/title?title='
];
let post = '