// ==UserScript==
// @name [LiveChart] Quick Search
// @description It adds quick seach buttons for other sites on LiveChart (season charts and anime pages).
// @author nht.ctn
// @namespace https://github.com/nhtctn
// @version 1.1.1
// @license MIT
// @icon https://images2.imgbox.com/f4/a8/i0WG5otW_o.png
// @match *://www.livechart.me/*
// @match *://www.turkanime.co/?q=*
// @grant GM_addStyle
// @run-at document-end
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://greasyfork.org/scripts/427315-url-based-search-for-some-websites/code/URL%20Based%20Search%20for%20Some%20Websites.js
// ==/UserScript==
/*jshint esversion: 6 */
/* global $ */
(function() {
'use strict';
// CONTROL BOARD
var sites = // Add New Buttons // Search parameters: %title%
[//===========================================================================================================================================================================================
{ name: 'AnimeBytes', status: 'active', url: 'https://animebytes.tv/torrents.php?searchstr=%title%&force_default=1', chart: "0", page: "1", color: '#ed106a', hover_color: '#323442', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEa8AABGvAff9S4QAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAANlSURBVFhHvVdJaxRBFG4EUSRJL5NF4xIVcUEQ8aD+CS8iQlQ8STJVPUkQEUQPAQ0qGD2IImgQEREUwZt3QUJwyUWQHMxBBSWZ7ulZNIuRjN/r1Mz0UjPdMyZ+8DFJ1Xvfq6r3Xne1EheOOqBlNHYqq6e6xZCST6R2Wyr/aGvMsjU+ntH4SFrjJ8lWmPw7Mnr/FlvndxBkxtL4q0Wlbw2N59f3tdkq+4bAxTDZDOYeTbeaO12RRlBUelZbGruOoL+F8Ifihp51YlpBgCv+oGHCfyGjmcNev1jItvAdCPy+IsQdHOtWMe0CRz/qDRbBccvo3ShcayPdnNxlq/y7VyCrm0kxXQbGJ7w2kUS6Mlr/PuEuB+08GBz8VFQGVwmTMjD+PGAXTZX9qHoSSzmvHHuJyONpYeIDhA7CfjFoH01zrFTIPqDSrwaNMyrPFrsG1wqTELC4gUYWgXa9ISSWYOtsM4RK1V4mAjwTJlWRM/gh2L4EZ72+tUjd4WtR7P62zBDjvcIkEpbR15LR+QX4/QrpSIj2HCk7YkDqZBnJw65RHbCMgT1o0a8yPT/ZTDpxvpl23y03cHPVJXTrAjT3ouILMk0/zRNUSPflk7xYbBtsEpp1A4u/KNP0kmJTP78LTpRY6DjXLvTqBr2QoBFVmG9pAenAYJmOyvcLvYaANLyW6Xo4jRSE269ERzfPCK2GgDQ8lOmWSLFrLgB8IbQagq2ajyWaPlIKpoODFbI5yzgb7y0mAdrxjVy3QiyAjckmKmS3hF5dyHWaCXriyTUrrNmGRErRVAPFiAK8LNMLUsnq/LhsIsDJQkcydks6reYB91om1/JRmWrjTfGeWnwi1xx9x3ODh+8UVek64ZgfyCbDpMsmH0onzE7X0QPKua2mhuLuvETXOauy7fhnPjhZg/OonVFqM/w+pb+xiT8Su0i6CyAgDddkBitNEV5R6JqEXUT27XJThF9Cob2/Aw+PLzLDlaIIXQG9y//nIkRYP6jnlzMdKNKqnSFChkE1gZbDTZnNyRxjchbBLzkGOyqZcynCVYejprbhNO6hS/IyARlh7+BVfJN8SYOu9hifDNoR3SBxQB+YlsGPoUbu4nuB0kNPu59YWA6/n+nNh90O4xP+CD1dhVsZuPxusnXzCWwcnCpeUkS28BcsrCLIFNRP+gAAAABJRU5ErkJggg=='},
{ name: 'Nyaa', status: 'active', url: 'https://nyaa.si/?&q=%title%', chart: "1", page: "1", color: '#337ab7', hover_color: '#AF00FF', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAHmElEQVRYw8WXXYxdVRXHf2vvc849537MvTOdmQ4zUygtpS0FIWL4iBEE9cGqAU0gojHBxAef9MFETXwhRmM00ReNia8kmhh9g0R8kISYiFjAKqYNhZa2Qzud7897zz0fey8fzqVzoS2UJ3Zyc25y99nrt/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srDlOTAunF4uiULDagrfe95xcs2QnVvFW2C8tWPCqRgkF75yd/OqRhyrGw5NWUILzRr89IsJzisgWPGERlnteg5MVCC7WwYRYbptSQs4s+7Z6pasn7rExZWCotPgHPEOwMmTBZ86XGN27Np9aXmz5G8nMh65s0Y7MdjBrTYtDP+bd9y8693vnlhwPHOyYCyGzQwevxXeXi7JSiX1AQe0P7wNDV+9t3HN4KpwftXzxD0x7USG7AR54fn0LSF2aEOfWfG8PFdyZNKSO5huCAcmQ+o1w1hD6GPIL21UR/xH/ff8/7zueff8JH+eAAAAAElFTkSuQmCC'},
{ name: 'AnimeTosho', status: 'active', url: 'https://animetosho.org/series/%title%', chart: "1", page: "1", color: '#063207', hover_color: '#D67A6E', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAADrSURBVDhPtVKxDcJADLSERMEqIEU0tEyARGo6qOjCGlRhEhIxACOgtIxARUVDccTmnbw/nyJCnPRS4rfPd/bT34B7hYRmoFHSnnGG0wNwKXHgXSGjJWhSoHza5IZ0c4uTaMLh3N9FG5icCi/4F4o8JWvBqcK1BK0KcJ0QSPYlFWkCRzY/tl3k3hWx0inlrcVvwV4GxCh2defAJ8eUkPO3hsCTFPPIpGxHY10FTr58M1mwLi5Y0LqJdWcQEgQrDGO+HYEhCFap//6AjX9G6EkIdXW11HCd5g0oYpMfBJ1+7AkPgpGv51fSfhB9ADUGVK7f/SFaAAAAAElFTkSuQmCC'},
{ name: 'IMDB_Google', status: 'active', url: 'https://www.google.com.tr/search?q=%title%+imdb', chart: "1", page: "1", color: '#1a73e8', hover_color: '#333333', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QA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w67GU5FtrIhZQssWB5u1OJDhsG3WaplUf5CQjw0SkBEsaZuHivnQ0c/M5HmzhATl4tsZJU/PwFhuBRBw4s9mKs/L/FrphW2Tfmc1Oik19a+H7Nr5ri377Unass8MXYBrKDLd2qVVFpRQiKRbdLBp9LB7hAxlo3eaigq/M92jEierK4XeCwaBPVcPiXHv7JQZFpBQzDg6NRq+U4mP5CDEmWrY5HzEJJ/LSLDIbRFZCoq965x/caoySSUYah/RzGTL62Q+6aJEWHnoUJETH335hg9sbWB6F1+lkei3Ns4ZlhpMxSlqnmgXYSqUjCokwCYk7hlL6XaRlswOFWdZOjgDDovCR5eH0KgOkDA0yPMgkI41J+nlvI0euo/kI76c7fqAV1i4x3/F4AtOisPeukUmO7TJAyvgUISEjWbQ7ykjGDhl6N42W+D4k7Kj9vYMjmfP1KNyQK2Ysp9cPN3EuZFpK6xR3RIZSEmEsSIqG61OHAPh/Ymf9cCEr1dYkGBGoBywZnQsyElqOvOZW7pA2HRnLaQ2mqFhEilVnXcoQQEOL3FzAV6xYYYnCfOuKkel1/So7Omvl9wFdwhFdDRMko36AUC5xepZCMxSoFJ9WFqQX6XO/R5n94X6YfH0lJwfnT+YAKTOcdExpIF3KNWyn0lJZvi++7b0XfItTBerfmWqFWbbOwIMC7mGXTK9ut/eZsRnmM2sWWe/IJNNBUNXC35Hfil5c3Olm2bXjnyyvUuGkyLi93uX3pdoPXSmZKYFEn6860WbZmB3U755b6js3uzRwTp4T2Vh8AV/13fL6UEun+x+cGnIziupdgQAAAABJRU5ErkJggg=='},
{ name: 'PlanetDP', status: 'passive', url: 'https://www.planetdp.org/movie/search?title=%title%', chart: "1", page: "1", color: '#f80', hover_color: '#3F51B5', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAf1JREFUOI2Vkz1I1WEUxn/nvP/bjXuvtyLNRqvFjC5GFBUWdKmlpWhsDLcWuWNDNDekODY0RoNTOFWLGiERVt5r3qxAxPIjHKSS6P++72nwqy8tD5zpnOfHw8M5YmbCpLYSaUFkkH1hiS2UAtAS62Aes17eJ1e2AsDMZK3fZJptQh/Z22TOJpKLv8w26HXAWCFv1YbdZiY2nrlm4xmzembG6tsO/xswlj1gtXzWqrlXNprvXluoZas2ljWrZYeslj34N8ByBl5LePWYvsNCF6OFeaoNxzn0rYR3FaLrAPeaWu4J1Vz7nyEGLeETJU2mLDjMS6OlDPOiWKP0tYegBb7LIN6dIrgRXhYeM9LQwUhRVwCuDS85UjdFUPCKmANEeb4jR/vnJaLrM788I7iyRR3E5PKqg1aiFgluUoJDxEVSKXNksQ1zJZ7tmiW6XoLDUgepG5YoJzi62JesONhP1EZwS6g+4NjCJQCeNvWjegEgelBlGqyTkwsPVzMQG2jKR+OLinRyZu4uAEPNN6NxQ51hHkSZR6xCx6d7v99RQtSdKgIWiwzsLWP0o7JdAhAlClzn9OytjQ4xIZVGUyFGd9slRAxdsXsHrMLZmU1/IwHZQxQUsBQV5b6qdVH+OL+ZcB2g2iIBEIYRu8q5D/X/Ef6UgUVEKpyf7tmKcLV+AFjUL400aZecAAAAAElFTkSuQmCC'},
{ name: 'TürkAnime', status: 'active', url: 'https://www.turkanime.tv/?q=%title%', chart: "1", page: "1", color: '#2c2c2c', hover_color: '#222222', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAAlJSURBVFhHtVcJVJNnFnVrrdPlnJ7pnDkzY62jjLWOlZ7SsbVVwxLABaxYiqIgWpUdYoggsv2EJKyCaCubyCqEJGyBJIQIRJA9iGwClkqluFRtq47TWkW5832/sa0zuByduee8k+TP97173/3e+/Nn0tMiUdY8g8nXvBKXWf6yXN73vPHyA2AYZorx7bMjUSabk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beojs2HuF55I71vJmty2nagIHhwurvLgz93N/dhGO68vEr50+jtakOo8M9+HakHz98+xWa66sw2NuK0TPdOHv6BBLixAdmzpw5g6R99APJb0GfishYHrfxEg6vc+Gt/fOcZeNzTW2RnJqOq5fOsET0daCnBeXlSshlhRgZ6vrluqG5FrU6FZSlcnBt1rWbmZk9R9I+WQPex8aQhJXE+p8WLLa7NmueBeYusERzQzUa9RqWZPRMLyqVZUhOTkbyviQcq1Gx1y+fGyRrqvDmImu8/jdzLDC1VHM4nGk0SNonF+G3f//0tYK4Awu5zmNUAA3T92xJlUMsEbVfXVGMvLw8KGRStLa2YqjfwH7XoNfir/MtiADO+IdLrbxIuqnUBaOIJ4cgIeFFi42+wplzlxlFmMN503bWekpELe9sO4a+k01oI7bTz+1NNUg5mILZRMBbppaX5s+f/3sTE5PpTyWAgj4nvPP+2rT7LlARYnE0kpMScW64Fyda63CyvZ40XhtiY+OxbYc//jJ3OWaacPDekhWpNMeCBQueN/bB08HdPeC1OW9xu+6LoGdLCdy2eMJ2tRPmvW0Nsw/syE+0OfsdXTP7TfM7K1bYcch2eu70SejZ/qrZOXj9g1R//VcnHh5UhNkSuzMrVqyYTrZOodb/L/4rTl7KdeWYLLRuIwR3JiKmQcnfMrX+zsPDZxfdQ+KZiR8An584g2Pr6jnvbdumWfMs/0mPggYlpqP6znvcrx3Xb1xPqn/FuOX/g08/lU91d2d+5x8gWurly3AlkuSFIQzzLp/Pp3e9J5j3SZP+DdeWdEWLOah8AAAAAElFTkSuQmCC'},
{ name: 'Example', status: 'passive', url: 'https://nyaa.si/?&q=%title%', chart: "1", page: "1", color: '#2c2c2c', hover_color: '#222222', icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuOWwzfk4AAAlJS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rPn9mb0PehtbCiJ+aZSK0HStBX88JdHa0oaWxBg2aw2ioSELH0RSMdB7pXrXZ28lig4fUmP7x2CiIWU4FbAiIZlwFIlci4JqVa8BNJxeXhRcvdr0YH8Pk5Walrmquko7VFB1E0/FaqJUyXBodQEdLLboNehzPC0dVUTTio3YWmds5czi2q82N6R8P5vPceZbeojs2HuF55I71vJmty2nagIHhwurvLgz93N/dhGO68vEr50+jtakOo8M9+HakHz98+xWa66sw2NuK0TPdOHv6BBLixAdmzpw5g6R99APJb0GfishYHrfxEg6vc+Gt/fOcZeNzTW2RnJqOq5fOsET0daCnBeXlSshlhRgZ6vrluqG5FrU6FZSlcnBt1rWbmZk9R9I+WQPex8aQhJXE+p8WLLa7NmueBeYusERzQzUa9RqWZPRMLyqVZUhOTkbyviQcq1Gx1y+fGyRrqvDmImu8/jdzLDC1VHM4nGk0SNonF+G3f//0tYK4Awu5zmNUAA3T92xJlUMsEbVfXVGMvLw8KGRStLa2YqjfwH7XoNfir/MtiADO+IdLrbxIuqnUBaOIJ4cgIeFFi42+wplzlxlFmMN503bWekpELe9sO4a+k01oI7bTz+1NNUg5mILZRMBbppaX5s+f/3sTE5PpTyWAgj4nvPP+2rT7LlARYnE0kpMScW64Fyda63CyvZ40XhtiY+OxbYc//jJ3OWaacPDekhWpNMeCBQueN/bB08HdPeC1OW9xu+6LoGdLCdy2eMJ2tRPmvW0Nsw/syE+0OfsdXTP7TfM7K1bYcch2eu70SejZ/qrZOXj9g1R//VcnHh5UhNkSuzMrVqyYTrZOodb/L/4rTl7KdeWYLLRuIwR3JiKmQcnfMrX+zsPDZxfdQ+KZiR8An584g2Pr6jnvbdumWfMs/0mPggYlpqP6znvcrx3Xb1xPqn/FuOX/g08/lU91d2d+5x8gWurly3AlkuSFIQzzLp/Pp3e9J5j3SZP+DdeWdEWLOah8AAAAAElFTkSuQmCC'},
];//==========================================================================================================================================================================================
var removes = // Remove Existing Buttons (Only removes from seasonal charts)
[//=====================================================================
{ name: 'Official Site', remove: "no", class: '.website-icon' },
{ name: 'Trailer', remove: "no", class: '.preview-icon' },
{ name: 'Official Ways to Watch', remove: "remove", class: '.watch-icon' },
{ name: 'Twitter', remove: "remove", class: '.twitter-icon' },
{ name: 'AniList', remove: "no", class: '.anilist-icon' },
{ name: 'MAL', remove: "no", class: '.mal-icon' },
{ name: 'AniDB', remove: "no", class: '.anidb-icon' },
{ name: 'AnimePlanet', remove: "remove", class: '.anime-planet-icon'},
{ name: 'AniSearch', remove: "remove", class: '.anisearch-icon' },
{ name: 'Kitsu', remove: "no", class: '.kitsu-icon' },
{ name: 'Crunchyroll', remove: "remove", class: '.-lc-icon-only' },
{ name: 'Crunchyroll', remove: "remove", class: '.crunchyroll-icon' },
];//=====================================================================
// Set required styles and hovers
var styles = `
#LiveChart648 {
display: flex;
justify-content: center;
align-items: center;
}
#LiveChart648-page .btn {
border-color: transparent;
}
#LiveChart648-page .btn:hover {
opacity: .75;
}
`;
// SEASONAL CHART
var pageUrl = window.location.href;
var title, titleArea,anidbID;
if (pageUrl.search(/livechart\.me\/(tba|summer-|winter-|fall-|spring-)/) >= 0) {
// PlanetDP exception
var myScriptCheck = document.querySelector( '[id="LiveChart648"]' );
if (myScriptCheck)
{
var g = getFirstItem(sites, 'name', 'PlanetDP');
if (g) {sites[g].status = 'deactive';}
}
for( var i = 0, len = sites.length; i < len; i++ )
{
styles += "." + sites[i].name + ":hover {background-color: " + sites[i].hover_color + "; border-radius: 15px;} ";
}
GM_addStyle ( styles );
// Work on each anime
var elBox = document.querySelectorAll( '[class="anime-card"]');
for ( var x = 0; x < elBox.length; x++ )
{
// Vars
title = titleEdit( elBox[x].querySelector( '[class="main-title"]' ).textContent );
var editedTitle = title
.replace( /(:)?(second|third|[0-9](st|nd|rd|th)|(II|III|IV|V|VI)(st|nd|rd|th))? (season part|part|season chapter|chapter|season) ?(two|three|four|five|[0-9]|II|III|IV|V|VI)?/i, "" )
.replace( / (2|3|4|5|II|III|IV|V|VI)$/i, "" );
//if it exist, get the anidb id. If does not exist but needed, replace url
let anidbButon = elBox[x].querySelector( '[class="anidb-icon"]' );
let r;
if (anidbButon) {
anidbID = anidbButon.href.match( /\/a(\d+)/ )[1];
r = getFirstItem(sites, 'name', 'AnimeTosho');
if (r != null) {sites[r].url = 'https://animetosho.org/series/%anidbID%';}
}
else {
r = getFirstItem(sites, 'name', 'AnimeTosho');
if (r != null) {sites[r].url = 'https://animetosho.org/search?q=%title%';}
}
// Areas
var count = x;
titleArea = elBox[x].querySelector( '.related-links > .icon-buttons-set' );
titleArea.innerHTML += chartHtml();
// Romove Sites
for (let z = 0; z < removes.length; z++) {
var n = removes[z];
if (elBox[x].querySelector(n.class) && n.remove == "remove") {
elBox[x].querySelector(n.class).style.display = "none";
}
}
}
}
// PAGE
else if (pageUrl.search(/livechart\.me\/anime\/\d+/) >= 0) {
// Vars
title = titleEdit( $('[property="og:title"]').attr("content") );
//if it exist, get the anidb id. If does not exist but needed, replace url
let anidbButon = document.querySelector( 'a.lc-btn-anidb' );
let r;
if (anidbButon) {
anidbID = anidbButon.href.match( /\/a(\d+)/ )[1];
r = getFirstItem(sites, 'name', 'AnimeTosho');
if (r != null) {sites[r].url = 'https://animetosho.org/series/%anidbID%';}
}
else {
r = getFirstItem(sites, 'name', 'AnimeTosho');
if (r != null) {sites[r].url = 'https://animetosho.org/search?q=%title%';}
}
// Areas
titleArea = document.querySelector( 'a.lc-btn-myanimelist, a.lc-btn-anilist, a.lc-btn-anidb' ).closest('div');
titleArea.insertAdjacentHTML( "afterend", pageHtml() );
}
function pageHtml() {
var h = '';
for( var i = 0, len = sites.length; i < len; i++ ) {
var p = sites[i];
if (p.status == "active" && p.page == 1) {
h += '<a class="btn btn-sm btn-block lc-btn-' + p.name.toLowerCase() + '" href="' + url( p.url ) + '" target="_blank" rel="noopener nofollow">' + p.name.toUpperCase() + '</a>';
styles += '.lc-btn-' + p.name.toLowerCase() + ', .lc-btn-' + p.name.toLowerCase() + ':hover, .lc-btn-' + p.name.toLowerCase() + ':focus {background-color: ' + p.color + '; color: white}';
}
}
GM_addStyle(styles);
return `<div class="text-sm font-medium mt-4 h-8">Search On</div><div id="LiveChart648-page" class="grid grid-cols-2 md:grid-cols-3 gap-2"> ${h} </div>`;
}
function url( g_site )
{
g_site = g_site
.replace( /%title%/, title )
.replace( /%editedTitle%/, editedTitle )
.replace( /%anidbID%/, anidbID );
return g_site;
}
function chartHtml()
{
var h = '';
var styles;
for( var i = 0, len = sites.length; i < len; i++ )
{
var s = sites[i];
if (s.status == "active" && s.chart == 1) {
h += '<a id="LiveChart648" class="' + s.name + '" href="' + url( s.url ) + '" target="_blank" rel="noopener nofollow"><img style="height:16px; weight: 16px;" src="' + s.icon + '" title="' + s.name + '"><\/a>';
}
}
return h;
}
function titleEdit( e_title )
{
e_title = e_title
.replace( ":", " " )
.replace( "-", " " )
.replace("&","&") //replace & with code
.replace(" ","") //delete nobreak space
.replace(/[\/\\#+()$~%"*?<>{}]/g, " ") //remove bad chars
.replace( /\s{2,}/g, " " )
.trim()
;
return e_title;
}
function getFirstItem(input, key, value) {
for(var i = 0; i < input.length; i++) {
var obj = input[i];
if(obj[key] == value) {return i;}
} return null;
}
})();