CCTV视频解析

将CCTV视频解析成HLS地址.

目前為 2023-06-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name:en-US           CCTV-HLS
// @name                 CCTV视频解析
// @description:en-US    parse cctv video to hls url.
// @description          将CCTV视频解析成HLS地址.
// @namespace            https://gf.qytechs.cn/users/135090
// @version              0.8
// @author               ZWB
// @license              CC
// @grant                none
// @run-at               document-end
// @match                https://v.cctv.com/*/V*.shtml*
// @match                https://v.cctv.cn/*/V*.shtml*
// @match                https://tv.cctv.cn/*/V*.shtml*
// @match                https://tv.cctv.com/*/V*.shtml*
// @icon                 https://tv.cctv.cn/favicon.ico
// ==/UserScript==
(function(){
    setTimeout(function(){
        if (this.videoid == "myPlayer") {
            var mpu="https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid="+guid;
            var cctvb=document.createElement("a");
            cctvb.style.display="grid";
            cctvb.textContent="#JSON#";
            cctvb.style.fontSize="2rem";
            cctvb.style.color="#48EFEF";
            document.querySelector("#via_title").appendChild(cctvb);
            cctvb.href=mpu;
            document.querySelector("#myPlayer").remove();
            $.getJSON(mpu,function(res){
                var cctva=document.createElement("a");
                cctva.style.display="grid";
                cctva.textContent="#MP4#";
                cctva.style.fontSize="2rem";
                cctva.style.color="#28EFEF";
                document.querySelector("#via_title").appendChild(cctva);
                cctva.href=res.video.chapters4[0].url;
            });
        }
        else
        {
            setTimeout(function(){
                document.querySelector(".video_left").remove();
            },1000);
            var mu="https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid="+guid;
            var cctvb=document.createElement("a");
            cctvb.style.display="grid";
            cctvb.style.float="left";
            cctvb.textContent="#JSON#";
            cctvb.style.fontSize="2rem";
            cctvb.style.color="#48EFEF";
            document.querySelector(".video").parentElement.firstElementChild.appendChild(cctvb);
            cctvb.href=mu;
            $.getJSON(mu,function(res){
                var cctva=document.createElement("a");
                cctva.style.display="grid";
                cctva.style.float="right";
                cctva.textContent="#HLS#";
                cctva.style.fontSize="2rem";
                cctva.style.color="#28EFEF";
                document.querySelector(".video").parentElement.firstElementChild.appendChild(cctva);
                cctva.onclick=function(){
                    window.open(res.hls_url);
                };
            });
        }
    },500);
})();

QingJ © 2025

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