Greasy Fork

Kinopoisk Redirect

Redirect from kinopoisk.ru to w3w.kpfr.cc

目前为 2024-03-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         Kinopoisk Redirect
// @namespace    https://t.me/johannmosin
// @version      0.1
// @description  Redirect from kinopoisk.ru to w3w.kpfr.cc
// @author       Johann Mosin
// @match        https://www.kinopoisk.ru/*/*/
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Get the current URL
    var currentUrl = window.location.href;

    // Extract the type and id from the URL
    var parts = currentUrl.split('/');
    var type = parts[3];
    var id = parts[4];

    // Construct the new URL
    var newUrl = 'https://w3w.kpfr.cc/' + type + '/' + id + '/';

    // Redirect to the new URL
    window.location.href = newUrl;
})();