Greasy Fork is available in English.

哔哩哔哩(b站)评论个人资料页添加uid位数和uid

显示UID和位数

// ==UserScript==
// @name         哔哩哔哩(b站)评论个人资料页添加uid位数和uid
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  显示UID和位数
// @author       原作者AN drew
// @match        https://www.bilibili.com/video/*
// @match        https://www.bilibili.com/bangumi/*
// @match        https://www.bilibili.com/cinema/*
// @match        https://www.bilibili.com/documentary/*
// @match        https://www.bilibili.com/tv/*
// @match        https://www.bilibili.com/variety/*
// @match        https://member.bilibili.com/*
// @require      https://lib.baomitu.com/jquery/3.6.3/jquery.min.js
// @require      https://lib.baomitu.com/jquery-cookie/1.4.1/jquery.cookie.min.js
// @grant        GM_setClipboard
// ==/UserScript==

var openbarrage=0;

function v()
{
    setInterval(function(){
        if($(".mini-avatar").length>0)
        {
            $(".mini-avatar").hover(function(){
                if($(".myinfo").length==0)
                {
                    var $div = $(".coins").clone(true)
                    $div.empty()
                    $div.attr("class","myinfo")
                    $div.css({"vertical-align":"top","margin-top":"5px"})
                    $div.append($uid)
                    if($.cookie("registration_days")!=undefined && $.cookie('registration_id')==uid)
                    {
                        $div.append($time2)
                        $(".level-content").before($div)
                        $("#time").text($.cookie("registration_days")+'\u00a0')
                    }
                    else
                    {
                        $div.append($time)
                        $(".level-content").before($div)
                    }
                    if(uid!=undefined)
                        $("#id").text(uid+" ")
                }
            })
        }
        else if($('.bili-header .header-avatar-wrap').length > 0) //新版avatar
        {
            $('.bili-avatar').hover(function () {
                if ($('.myinfo').length == 0) {
                    var $div = $('.coins-item').clone(true);
                    $div.empty();
                    $div.attr('class', 'myinfo');
                    $div.css({ 'vertical-align': 'top', 'margin': '5px 0px 5px 0px' });
                    $div.append($uid);
                    let $time22=$time2.clone();
                    $time22.css('margin-left','5px');
                    if ($.cookie('registration_days') != null && $.cookie('registration_id') == uid) {
                        $div.append($time22);
                        $('.coins-item').before($div);
                        $('#time').text($.cookie('registration_days') + '\u00a0');
                    }
                    else {
                        $div.append($time);
                        $('.coins-item').before($div);
                    }
                    if (uid != undefined) { $('#id').text(uid + ' '); }
                }
            });
        }
    },1000)
    //});








    function dec(x)
    {
        let r = 0;
        for (var i = 0; i < 6; i++)
        {
            r += tr[x[s[i]]] * (58 ** i);
        }
        return 'av' + String((r - add) ^ xor);
    }
    function enc(x)
    {
        x=(x^xor)+add;
        let r=['B','V',1, , ,4, ,1, ,7, , ];
        for (var i = 0; i < 6; i++)
        {
            r[s[i]]=table[parseInt(x/58**i)%58];
        }
        return r.join("");
    }

    setInterval(function(){
        if(window.location.pathname.indexOf("BV") > -1 || window.location.pathname.indexOf("bv") > -1)

 //下面到功能实现代码part
   

        // 对于.user-card-m类型的用户卡片
$(".user-card-m").each(function(){
    if($(this).find(".uuid").length==0){
        var $uuid = $("<span class='uuid'></span>");
        $uuid.attr("style","background: rgb(124, 212, 242); color: blue; font-size: 20px; vertical-align:middle; margin-right:180px; padding-left:4px; padding-right:4px; border-radius:4px; font-weight:normal; width:100px;");
        var userId = $(this).find(".user .name").attr("href").substring($(this).find(".user .name").attr("href").lastIndexOf("/")+1);

        // 添加UID文本,下面同理
        $uuid.text("  UID: "+userId+"  ");

        // 创建并添加UID位数的标签,下面同理
        var $uidLength = $("<span class='uid-length'></span>");
        $uidLength.attr("style", "color: blue; font-size: 20px; vertical-align:middle; margin-left: 5px;");
        $uidLength.text("(位数:" + userId.length + ")");

        // 将两者都插入到.social区域
        $(this).find('.social').prepend($uuid).prepend($uidLength);
    }
});
        // 对于.user-card-m-exp类型的用户卡片
        $(".user-card-m-exp").each(function(){
            if($(this).find(".uuid").length==0){
        var $uuid = $("<span class='uuid'></span>");
        $uuid.attr("style","background: rgb(124, 212, 242); color: blue; font-size: 20px; vertical-align:middle; margin-right:180px; padding-left:4px; padding-right:4px; border-radius:4px; font-weight:normal; width:100px;");
        var userId = $(this).find(".user .name").attr("href").substring($(this).find(".user .name").attr("href").lastIndexOf("/")+1);

        // 添加UID文本,下面同理
        $uuid.text("  UID: "+userId+"  ");

        // 创建并添加UID位数的标签,下面同理
        var $uidLength = $("<span class='uid-length'></span>");
        $uidLength.attr("style", "color: blue; font-size: 20px; vertical-align:middle; margin-left: 5px;");
        $uidLength.text("(位数:" + userId.length + ")");

        // 将两者都插入到.social区域
        $(this).find('.social').prepend($uuid).prepend($uidLength);
    }
});
        // 对于.user-card类型的用户卡片
        $(".user-card").each(function(){
            if($(this).find(".uuid").length==0){
        var $uuid = $("<span class='uuid'></span>");
                //颜色显示选择列
        $uuid.attr("style","background: rgb(124, 212, 242); color: blue; font-size: 20px; vertical-align:middle; margin-right:180px; padding-left:4px; padding-right:4px; border-radius:4px; font-weight:normal; width:100px;");
        var userId = $(this).find(".user .name").attr("href").substring($(this).find(".user .name").attr("href").lastIndexOf("/")+1);

        // 添加UID文本
        $uuid.text("  UID: "+userId+"  ");

        // 创建并添加UID位数的标签
        var $uidLength = $("<span class='uid-length'></span>");
        $uidLength.attr("style", "color: blue; font-size: 20px; vertical-align:middle; margin-left: 5px;");
        $uidLength.text("(位数:" + userId.length + ")");

        // 将两者都插入到.social区域
        $(this).find('.social').prepend($uuid).prepend($uidLength);
    }
});
    },1)

    //此处结束part


    setInterval(function(){
        if($("#activity_vote").length>0)
        {
            $("#activity_vote").hide()
        }
        $(".video-page-game-card").hide()
    },10)


    setInterval(function(){
        if($(".pop-live.report-wrap-module.report-scroll-module").length>0)
        {
            $(".pop-live.report-wrap-module.report-scroll-module").hide()
        }
    },500)

   



    setInterval(function(){
        $("#bannerAd").remove();
        $(".gg-floor-module").hide()
        $("#slide_ad").hide()
        $(".video-ad-creative-card").hide()
        $('.ad-report').hide()
        $(".bilibili-player-video-danmaku-setting-left-block-title").attr("style","color:#FF0000; font-weight:bold")

        var ban ='<img class="ban" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/'+
            'PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBo'+
            'aWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTkxNjkyMzAyOTAzIiBjbGFzcz0iaWNvbiIgdmlld0JveD0i'+
            'MCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI4'+
            'NjkiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiPjxk'+
            'ZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+QGZvbnQtZmFjZSB7IGZvbnQtZmFtaWx5OiBlbGVtZW50LWljb25zOyBzcmM6'+
            'IHVybCgiY2hyb21lLWV4dGVuc2lvbjovL2JiYWtobm1ma2plbmZiaGpkZGRpcGNlZm5ocGlramJqL2ZvbnRzL2VsZW1lbnQt'+
            'aWNvbnMud29mZiIpIGZvcm1hdCgid29mZiIpLCB1cmwoImNocm9tZS1leHRlbnNpb246Ly9iYmFraG5tZmtqZW5mYmhqZGRk'+
            'aXBjZWZuaHBpa2piai9mb250cy9lbGVtZW50LWljb25zLnR0ZiAiKSBmb3JtYXQoInRydWV0eXBlIik7IH0KPC9zdHlsZT48'+
            'L2RlZnM+PHBhdGggZD0iTTUxMiAwYTUxMiA1MTIgMCAxIDAgNTEyIDUxMiA1MTIgNTEyIDAgMCAwLTUxMi01MTJ6IG0zODQg'+
            'NTEyYTM4NCAzODQgMCAwIDEtNzEuMDQgMjIyLjA4TDI4OS45MiAxOTkuMDRBMzg0IDM4NCAwIDAgMSA4OTYgNTEyek0xMjgg'+
            'NTEyYTM4NCAzODQgMCAwIDEgNzEuMDQtMjIyLjA4bDUzNS4wNCA1MzUuMDRBMzg0IDM4NCAwIDAgMSAxMjggNTEyeiIgZmls'+
            'bD0iI0ZGMDAwMCIgcC1pZD0iMjg3MCI+PC9wYXRoPjwvc3ZnPg==">'
        var $ban = $(ban)
        $ban.css({"position":"absolute", "top":"17px", "left":"18px", "height":"10px", "width":"10px"})
        $(".bilibili-player-block-filter-type.disabled").find("svg").after($ban)
    },100)

}


(function() {
    'use strict';
    var css = '.player-auxiliary-area .bpx-player-filter:not(.bpx-player-filter-playlist){display:block!important}'+
        '.player-auxiliary-area .bui-dropdown-name.on{padding-bottom:3px}'+
        '.player-auxiliary-area .bui-dropdown-name:hover{padding-bottom:3px}'+
        '.user-card-m .info .user{margin-bottom:0px!important}'+
        '.user-card-m-exp .user-info-wrapper .info .user{margin-bottom:0px!important}'+
        '.user-card .info .user{margin-bottom:0px!important}';
    var head = document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    style.type = 'text/css';
    if (style.styleSheet) {
        style.styleSheet.cssText = css;
    }
    else {
        style.appendChild(document.createTextNode(css));
    }
    head.appendChild(style);

    var timer = setInterval(function(){
        if(window.jQuery)
        {
            clearInterval(timer)
            setTimeout(function(){
                v();
            },1500)
        }
    },100)
    })();