<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" referer="true" date="2021.01.13">
    <url><![CDATA[https?://(?:www\.)?(?:acfun|aixifan)\.(?:cn|com)/\w+/(?<id>[^/]+)]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA["(?:coverUrl|image)":"([^"]+)"]]></thumbnail>
    <duration><![CDATA["durationMillis":(\d+)000]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            //https://www.acfun.cn/bangumi/aa6000986_36188_1714862
            var title = window.pageInfo.title;
            var vq = parseInt((window.external.vq && window.external.vq.match(/\d+/) ? window.external.vq : '1080').match(/\d+/)[0]);
            var jo = JSON.parse(window.pageInfo.currentVideoInfo.ksPlayJson);
            var as = jo.adaptationSet.length != 0 ? jo.adaptationSet[0] : jo.adaptationSet;
            var video_url = as.representation[0].url || as.representation[0].backupUrl;
            for (var v in as.representation) {
                if (as.representation[v].height == vq || vq == 480 && as.representation[v].height == 540) {
                    video_url = as.representation[v].url;
                    break;
                }
            }
            document.body.innerHTML = 'title=\"' + title + '\",cr_video_url=' + video_url + '$' + document.body.innerHTML;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>