Go to biliplus

给tucao.one的某些页面的视频条目添加一个链接,一键跳转到对应的biliplus地址

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Go to biliplus
// @namespace    https://liu233w.github.io
// @version      1.0.2
// @description  给tucao.one的某些页面的视频条目添加一个链接,一键跳转到对应的biliplus地址
// @author       Liu233w
// @match        https://www.tucao.in/*
// @icon         https://www.google.com/s2/favicons?domain=tucao.one
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    if (window.location.href.indexOf("www.tucao.in/index.php?m=search&") > -1) {
        $('.list .info').each(function () {
            const href = $(this).find('a.blue').attr('href')
            const vid = href.match(/(h\d+)/)[0]
            $(this).append(`<a href="https://www.biliplus.com/play/${vid}/">BiliPlus</a>`)
        })

    } else if (window.location.href.indexOf("www.tucao.in/list/") > -1) {
        $('li .box').each(function () {
            const href = $(this).find('a.title').attr('href')
            const vid = href.match(/(h\d+)/)[0]
            $(this).find('.info').append(`<a href="https://www.biliplus.com/play/${vid}/">BiliPlus</a>`)
        })

    } else if (window.location.href.indexOf("www.tucao.in/play/") > -1) {
        const vid = window.location.href.match(/(h\d+)/)[0]
        $('.new_tool ul').prepend(`<a href="https://www.biliplus.com/play/${vid}/">BiliPlus</a>`)
    }

})();