亚洲审美车(极品比较多)

破解网站时长限制,需要自己注册登录

As of 2022-11-25. See the latest version.

// ==UserScript==
// @name         亚洲审美车(极品比较多)
// @namespace    http://tampermonkey.net/
// @version      1.8.2
// @license      MIT
// @description  破解网站时长限制,需要自己注册登录
// @author       总是怕来不及
// @match        https://theav101.com/*
// @match        https://theav108.com/*
// @match        https://theav109.com/*
// @require      https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.1.5/hls.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/dplayer/1.26.0/DPlayer.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=theav101.com
// @grant        none
// ==/UserScript==

function find(){
    document.querySelector('.table').remove()
    let body = document.body.innerHTML
    let end = body.search('m3u8')
    let start = body.search('v.cvhlscdn.com')
    let url = body.slice(start-8, end+4)
    window.dp = new DPlayer({
            element: document.querySelector(".player"),
            autoplay: true,
            theme: '#FADFA3',
            loop: true,
            lang: 'zh',
            screenshot: true,
            hotkey: true,
            preload: 'auto',
            video: {
                url: url,
                type: 'hls'
            }
        });
}

function isVideo(){
    let isvideo = 0
    let info = document.location
    let path = info.pathname
    let list = path.split('/')
    let i = null
    for (let i in list){
         if (list[i]==='videos'){
            isvideo = 1
         }
    }
    return isvideo
}

(function() {
    'use strict';
    let count = 1
    let login = document.getElementById('login')
    if (login){
        alert('使用脚本前,请手动注册登录')
    }
    else{
        let p = isVideo()
        if (p){
            setTimeout(async () =>{
                let url = find()
                }, 3000)
        }
    }

})();