哔哩哔哩直播回放链接提取工具

try to take over the world!

// ==UserScript==
// @name         哔哩哔哩直播回放链接提取工具
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  try to take over the world!
// @author       撒哈拉来的企鹅
// @match        https://live.bilibili.com/record/*
// @grant        GM_xmlhttpRequest
// @connect      *
// ==/UserScript==

(function() {
    'use strict';
    var topBox = "<div style='position:fixed;z-index:999999;background-color:#ccc;cursor:pointer;top:200px;left:0px;'>" +
        "<div id='getaddress' style='font-size:13px;padding:10px 2px;color:#FFF;background-color:#25AE84;'>获取下载地址</div>" +
        "</div>";
    $("body").append(topBox);
    $("body").on("click", "#getaddress", function () {
        var window_url = window.location.href;
        console.log(window_url.split("/")[4].split("?")[0]);
        GM_xmlhttpRequest({
            url: "https://api.live.bilibili.com/xlive/web-room/v1/record/getLiveRecordUrl?rid=" + window_url.split("/")[4].split("?")[0] + "&platform=html5",
            method: "GET",
            headers: {"Content-Type": "application/x-www-form-urlencoded"},
            onload: function (response) {
                var data = eval('(' + response.responseText + ')');
                var list = data.data.list;
                var text = "";
                for (var i = 0; i < list.length; i++) {
                    console.log(list[i].url)
                    text += ("<p>"+list[i].url +"</p>");
                }
                var myWindow=window.open('','','left=200,top=100,width=1000,height=500');
                myWindow.document.write(text);
                myWindow.focus();
            }
        });
    });
    
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址