Acfun-hls

Acfun跳转到M3U8地址,需配合Chrome浏览器的扩展HLS-Playback使用(支持西瓜视频)

  1. // ==UserScript==
  2. // @name Acfun-hls
  3. // @namespace https://gf.qytechs.cn/zh-CN/users/135090
  4. // @version 3.1.0
  5. // @description Acfun跳转到M3U8地址,需配合Chrome浏览器的扩展HLS-Playback使用(支持西瓜视频)
  6. // @author zwb83925462
  7. // @match https://www.acfun.cn/v/ac*
  8. // @match https://www.acfun.cn/player/*
  9. // @match https://www.ixigua.com/1*
  10. // @match https://www.ixigua.com/2*
  11. // @match https://www.ixigua.com/3*
  12. // @match https://www.ixigua.com/4*
  13. // @match https://www.ixigua.com/5*
  14. // @match https://www.ixigua.com/6*
  15. // @match https://www.ixigua.com/7*
  16. // @match https://www.ixigua.com/8*
  17. // @match https://www.ixigua.com/9*
  18. // @match https://www.ixigua.com/pseries/*
  19. // @grant unsafeWindow
  20. // @run-at document-end
  21. // @license CC
  22. // @noframes
  23. // ==/UserScript==
  24. 'use strict';
  25. (function(){
  26. //acfun
  27. if (location.hostname == 'www.acfun.cn') {
  28. var oldurl="old",newurl="new";
  29. document.addEventListener("mousedown", function() {
  30. oldurl=location.pathname;
  31. });
  32. document.addEventListener("mouseup", function() {
  33. setTimeout(loop,1000);
  34. });
  35. function loop() {
  36. if (unsafeWindow.videoInfo?.currentVideoInfo?.ksPlayJson == undefined) {
  37. setTimeout(loop, 500);
  38. }
  39. newurl=location.pathname;
  40. if (oldurl == newurl){
  41. if(document.querySelector("video").paused){
  42. console.info(newurl.substring(newurl.lastIndexOf("/")+1));
  43. }
  44. } else {
  45. var ksjs=JSON.parse(unsafeWindow.videoInfo?.currentVideoInfo?.ksPlayJson);
  46. var acdata = ksjs.adaptationSet[0].representation;
  47. var acvid=newurl.substring(newurl.lastIndexOf("/")+1);
  48. var idelement=`<span style="color:deeppink;margin:0 1vw">${acvid}>></span>`;
  49. if (location.pathname.indexOf("v") == 1) {
  50. document.querySelector("#movie-player").innerHTML=idelement;
  51. document.querySelector("#movie-player").style.height = "fit-content";
  52. document.querySelector("#movie-player").align = "center";
  53. } else {
  54. document.querySelector("#player").innerHTML=idelement;
  55. document.querySelector("#player").align = "center";
  56. }
  57. acdata.forEach(function (item, r) {
  58. var uhd = item.qualityLabel;
  59. var ddiv = document.createElement("a");
  60. ddiv.style.color = "#11AA11";
  61. ddiv.style.font = "caption";
  62. ddiv.style.margin = "0 2vw";
  63. ddiv.id = "hls" + r;
  64. ddiv.href = item.url;
  65. ddiv.innerText = "#" + uhd;
  66. ddiv.target = "_blank";
  67. if (location.pathname.indexOf("v") == 1) {
  68. document.querySelector("#movie-player").appendChild(ddiv);
  69. } else {
  70. document.querySelector("#player").appendChild(ddiv);
  71. }
  72. });
  73. }
  74. }
  75. loop();
  76. }
  77. //ixigua
  78. if (location.hostname == 'www.ixigua.com'){
  79. /**
  80. * var pdata=_SSR_HYDRATED_DATA?.anyVideo?.gidInformation?.packerData;
  81. * var guid=pdata?.video?.item_id?.length>0?pdata?.video?.item_id:pdata?.episodeInfo?.episodeId;
  82. */
  83. function xgloop(){
  84. if (!document.querySelector("video")){ setTimeout(xgloop,1000);}
  85. var gidim=unsafeWindow._SSR_HYDRATED_DATA?.anyVideo?.gidInformation;
  86. var guid=gidim.gid?.length>0?gidim.gid:(gidim.episodeId?.length>0?gidim.episodeId:gidim.packerData?.episodeInfo?.episodeId);
  87. var gidpath="/".concat(guid);
  88. var pdata=gidim.packerData;
  89. if (gidpath !=location.pathname || location.search.length>0){location=gidpath;}else{
  90. var pd=document.createElement("a");
  91. pd.innerText="嵌入式播放器";pd.href="/embed?group_id="+guid;
  92. pd.target="_self";
  93. pd.style="position:fixed;bottom:1%;left:1%";pd.style.display="table";
  94. pd.style.fontSize="1em";pd.style.margin="0 2em";
  95. document.body.appendChild(pd);
  96. var video_url=null,vd="MP4",vlist=[];
  97. if (pdata.video?.videoResource == undefined){
  98. vlist=Object.values(pdata.videoResource?.normal?.video_list).sort((a,b)=>b.vheight-a.vheight);
  99. }else{
  100. vlist=Object.values(pdata.video?.videoResource?.normal?.video_list).sort((a,b)=>b.vheight-a.vheight);
  101. }
  102. vd=vlist[0].definition;
  103. video_url=vlist[0].main_url;
  104. var videourl=(video_url==null)?"#":video_url;
  105. var pp=document.createElement("a");pp.style.display="table";
  106. pp.innerText=vd;pp.href=videourl;pp.target="_self";pp.style.color="#22AA11";
  107. pp.style="position:fixed;bottom:1%;left:11%";
  108. pp.style.fontSize="1em";pp.style.margin="0 2em";
  109. document.body.appendChild(pp);
  110. }
  111. }
  112. setTimeout(xgloop,500);
  113. }
  114. })();

QingJ © 2025

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