Acfun-hls

Acfun跳转到M3U8地址,需配合Chrome浏览器的扩展HLS-Playback使用

// ==UserScript==
// @name         Acfun-hls
// @namespace    https://greasyfork.org/zh-CN/users/135090
// @version      2.5.2
// @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/*
// @exclude      https://www.ixigua.com/*/
// @grant        none
// @runat        document-body
// @noframes
// ==/UserScript==
'use strict';
(function(){
    if (location.hostname == 'www.acfun.cn'){
        var acdata=JSON.parse(window.videoInfo.currentVideoInfo.ksPlayJson).adaptationSet[0].representation;
        var uhd =acdata[0].qualityLabel;
        var r=window.confirm("确定播放"+uhd+",取消播放标清")?0:acdata.length-1;
        void(window.location.href=(acdata[r].url));
    }
    if (location.hostname == 'www.ixigua.com') {
        var guid=_SSR_HYDRATED_DATA.anyVideo.gidInformation.gid>0?_SSR_HYDRATED_DATA.anyVideo.gidInformation.gid:(_SSR_HYDRATED_DATA.anyVideo.gidInformation.episodeId>0?_SSR_HYDRATED_DATA.anyVideo.gidInformation.episodeId:_SSR_HYDRATED_DATA.anyVideo.gidInformation.packerData.episodeInfo.episodeId);
        var gidpath="/"+guid;
        if (gidpath !=location.pathname || location.search.length>0) {
            location.href=guid;
        }else {
            setTimeout(function(){
                if (document.getElementsByClassName("ant-switch-checked").length>0){
                    void(document.querySelector(".ant-switch-checked").click());
                }
                alert("FullScreen!");
                if (document.querySelector("xgplayer-exitCssfullscreen-tips") == null){
                    document.querySelector(".xgplayer-cssfullscreen").click();
                }
                document.querySelectorAll(".icon-danmaku_on")[0].click();
            },2000);
        }
    }
})();