// ==UserScript== // @name CC163FullScreen // @namespace https://greasyfork.org/zh-CN/users/135090 // @version 1.4.0 // @description 获取M3U8地址并使用Dplayer播放 // @author ZWB // @license CC // @run-at document-end // @noframes // @require https://unpkg.com/dplayer@1.27.1/dist/DPlayer.min.js // @require https://unpkg.com/hls.js@1.4.10/dist/hls.js // @match https://cc.163.com/1*/ // @match https://cc.163.com/2*/ // @match https://cc.163.com/3*/ // @match https://cc.163.com/4*/ // @match https://cc.163.com/5*/ // @match https://cc.163.com/6*/ // @match https://cc.163.com/7*/ // @match https://cc.163.com/8*/ // @match https://cc.163.com/9*/ // @downloadURL none // ==/UserScript== (function() { 'use strict'; var nqcid=__NEXT_DATA__?.query?.ccid; var nppid=__NEXT_DATA__?.props?.pageProps?.roomInfoInitData?.live?.cid; var cid = nppid == undefined ? nqcid : nppid; //"https://coopapi.cc.163.com/v1/msharelive/share_data/?ccid="+cid; if (cid == undefined) {cid= -1;} var roomdata=__NEXT_DATA__?.props?.pageProps?.roomInfoInitData?.live; if (roomdata?.gametype == 95599){ cid = -9; } else{ if (cid > 0) { var liveurl="//cc.163.com/live/channel/?channelids="+cid; fetch(liveurl) .then((response) => response.json()) .then((data) => {return data?.data[0]}) .then((data)=>{ var nickname=data?.nickname; var cover=data?.cover; var sf=data?.sharefile; var startat=data?.startat; var isaudio=data?.is_audiolive; var ccid=data?.ccid; setTimeout(function(){ document.body.innerHTML=null; document.title=nickname; var vdiv=document.createElement("div"); vdiv.id="dplayer"; vdiv.style.width="auto"; vdiv.style.height="80%"; vdiv.style.align="center"; var adiv=document.createElement("a"); adiv.href="https://cc.163.com/"+ccid; adiv.textContent="直播间"+ccid+"于"+startat+"开播"; document.body.append(vdiv); document.body.append(adiv) if(isaudio==1){ document.body.innerHTML="

音频直播,暂不支持

"; }else{ var dp=new DPlayer({ container: document.getElementById('dplayer'), live: true, volume: 1.0, video: { url: sf, type: 'hls', pic: cover, }, }); dp.play(); } },1500); }); } } })();