// ==UserScript== // @name Acfun-hls // @namespace https://greasyfork.org/zh-CN/users/135090 // @version 3.0.1 // @description Acfun跳转到M3U8地址,需配合Chrome浏览器的扩展HLS-Playback使用(支持西瓜视频) // @author zwb83925462 // @match https://www.acfun.cn/v/ac* // @match https://www.acfun.cn/player/* // @match https://www.ixigua.com/1* // @match https://www.ixigua.com/2* // @match https://www.ixigua.com/3* // @match https://www.ixigua.com/4* // @match https://www.ixigua.com/5* // @match https://www.ixigua.com/6* // @match https://www.ixigua.com/7* // @match https://www.ixigua.com/8* // @match https://www.ixigua.com/9* // @match https://www.ixigua.com/pseries/* // @grant unsafeWindow // @run-at document-body // @license CC // @noframes // ==/UserScript== 'use strict'; (function(){ if (location.hostname == 'www.acfun.cn') { function loop() { if (document.querySelector("#ACPlayer") == null) { setTimeout(loop, 500); } var ksjs=JSON.parse(unsafeWindow.videoInfo.currentVideoInfo.ksPlayJson); var acdata = ksjs.adaptationSet[0].representation; if (location.pathname.indexOf("v") == 1) { document.querySelector("#movie-player").style.height = "fit-content"; document.querySelector("#movie-player").align = "center"; } else { document.querySelector("#player").align = "center"; } acdata.forEach(function (item, r) { var uhd = item.qualityLabel; var ddiv = document.createElement("a"); ddiv.style.color = "#11AA11"; ddiv.style.font = "caption"; ddiv.style.margin = "0 2vw"; ddiv.id = "hls" + r; ddiv.href = item.url; ddiv.innerText = "#" + uhd; ddiv.target = "_blank"; if (location.pathname.indexOf("v") == 1) { document.querySelector("#movie-player").appendChild(ddiv); } else { document.querySelector("#player").appendChild(ddiv); } }); } loop(); } if (location.hostname == 'www.ixigua.com'){ var gidim=unsafeWindow._SSR_HYDRATED_DATA.anyVideo.gidInformation; var guid=gidim.gid?.length>0?gidim.gid:(gidim.episodeId?.length>0?gidim.episodeId:gidim.packerData.episodeInfo.episodeId); var gidpath="/".concat(guid); if (gidpath.concat("/") == location.pathname ){location=gidpath;} if (gidpath !=location.pathname || location.search.length>0){location=gidpath;}else{ setTimeout(function(){ var pd=document.createElement("a"); pd.innerText="嵌入式播放器";pd.href="/embed?group_id="+guid; pd.target="_self"; pd.style="position:fixed;bottom:1%;left:1%";pd.style.display="table"; pd.style.fontSize="1em";pd.style.margin="0 2em"; document.body.appendChild(pd); var pdata=gidim.packerData; var video_url=null,vd="MP4",vlist=[]; if (pdata.video?.videoResource == undefined){ vlist=Object.values(pdata.videoResource.normal.video_list).sort((a,b)=>b.vheight-a.vheight); }else{ vlist=Object.values(pdata.video.videoResource.normal.video_list).sort((a,b)=>b.vheight-a.vheight); } vd=vlist[0].definition; video_url=vlist[0].main_url; var videourl=(video_url==null)?"#":"https:"+video_url; var pp=document.createElement("a");pp.style.display="table"; pp.innerText=vd;pp.href=videourl;pp.target="_self";pp.style.color="#22AA11"; pp.style="position:fixed;bottom:1%;left:11%"; pp.style.fontSize="1em";pp.style.margin="0 2em"; document.body.appendChild(pp); },1000); } } })();