Greasy Fork is available in English.
将CCTV视频解析成HLS地址.
当前为
// ==UserScript==
// @name:en-US CCTV-HLS
// @name CCTV视频解析
// @description:en-US parse cctv video to hls url.
// @description 将CCTV视频解析成HLS地址.
// @namespace http://greasyfork.icu/users/135090
// @version 0.5
// @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() {
'use strict';
setTimeout(function(){
var mu="https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid="+guid;
var cctvb=document.createElement("a");
cctvb.style.display="contents";
cctvb.style.float="left";
cctvb.textContent="#JSON#";
cctvb.style.fontSize="2rem";
cctvb.style.color="#0FFFFE";
document.querySelector(".video").appendChild(cctvb);
cctvb.href=mu;
if (document.querySelector("video") == null){
setTimeout(function(){document.querySelector("video").remove();},2000)
}else{
document.querySelector("video").remove();
}
$.getJSON(mu,function(res){
var cctva=document.createElement("a");
cctva.style.display="contents";
cctva.style.float="right";
cctva.textContent="#HLS#";
cctva.style.fontSize="2rem";
cctva.style.color="#8FFFFE";
document.querySelector(".video").appendChild(cctva);
cctva.onclick=function(){
window.open(res.hls_url);
};
});
},2000)
})();