Greasy Fork is available in English.

提取b站frame到wordpress

开启后,进入B站视频页面,单击获取外链按钮。即可复制1080P画质的外链frame到剪贴板

// ==UserScript==
// @name         提取b站frame到wordpress
// @namespace    http://tampermonkey.net/
// @version      0.52
// @description  开启后,进入B站视频页面,单击获取外链按钮。即可复制1080P画质的外链frame到剪贴板
// @author       月离
// @match        *://*.bilibili.com/*
// @grant        GM_setClipboard
// ==/UserScript==



function addBtn(){
    //1,利用createElement()创建一个标签对象
    var btn_url=document.createElement("button");
    var t=document.createTextNode("获取外链");
    btn_url.appendChild(t);

    //2,获得div对象
    var node2=document.getElementById("video-page-app");
    var node3=document.getElementsByClassName("dm");
    //alert(node3[0].getBoundingClientRect().top)
    var pos = node3[0].getBoundingClientRect();
    var pos_left;
    var pos_top;
    pos_left = pos.left +300;
    pos_top = pos.top -1.9;

    //添加成div对象的孩子
    node2.appendChild(btn_url);
    var content_url
    var width = 'auto';
    var height ='880px';
    content_url = '<div class="video"><iframe src="https://player.bilibili.com/player.html?aid=' + aid +  '&amp;bvid=' + bvid + '&amp;cid=' + cid + '&page=1&high_quality=1" '+'height="'+ height+' "frameborder="no" scrolling="no" allowfullscreen="allowfullscreen"> </iframe></div>';
    //GM_setClipboard(content_url,'text');
    btn_url.onclick =function(){
        //alert("已经成功复制到剪贴板!");
        GM_setClipboard(content_url,'text');
    }
    btn_url.style.cssText = 'position: absolute;left: ' + pos_left + 'px;top:'+ pos_top +'px;'+ 'color:#000000fc;border:solid 1px #8a8a8aa3;padding:2.5px;background: white;border-radius: 5px;cursor: pointer;'
}
window.onload = addBtn;