BiliPlus

哔哩哔哩错误视频自动跳转

当前为 2018-01-22 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         BiliPlus
// @namespace    https://www.biliplus.com/
// @version      1.02
// @description  哔哩哔哩错误视频自动跳转
// @author       SettingDust

// @include      http*://www.bilibili.com/*
// @include      http*://bangumi.bilibili.com/anime/*
// @include      http*://space.bilibili.com/*
// @include      http*://www.bilibili.com/bangumi/play/*

// @run_at       document_start
// @require      https://code.jquery.com/jquery-latest.js
// @grant        none
// ==/UserScript==
$(function(){
    var css = "";
    //添加订阅链接
    var fav=$('ul.fr li:eq(5)').prop("outerHTML");
    fav=fav.replace('favlist','bangumi');
    fav=fav.replace('收藏夹','订阅');
    $('ul.fr').append(fav);
    //收藏夹跳转
    $('body').mouseover(function(){
        let tmp=$('.small-item.disabled');
        tmp.removeClass('disabled');
        tmp.find('a').attr('href','https://www.biliplus.com/video/av' + tmp.attr('data-aid'));
        $('.disabled-cover').remove();
    });
    $("<style></style>").text(css).appendTo($("head"));
});

//视频跳转
$(window).load(function() {
	if ($('.error-container').length > 0)
        location.replace(location.href.replace(/\:\/\/www\.bilibili\.com\/video/, '://www.biliplus.com/video'));
    if ($('.video-list-status-text').length > 0)
        location.replace(location.href.replace(/\:\/\/bangumi\.bilibili\.com\/anime/, '://www.biliplus.com/bangumi/i'));
    if ($('.player-limit-wrap').length > 0)
        location.replace(location.href.replace(/\:\/\/www\.bilibili\.com/, '://www.biliplus.com'));
});