<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" date="2020.06.27">
    <url><![CDATA[(?is)https?://(?:vod\.)?afreecatv\.com/PLAYER/STATION/(?<id>[^/]+)]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA[<meta\s+content="([^"]+)"\s+property="og:image">]]></thumbnail>
    <duration><![CDATA[nTotalFileDuration\s+=\s+'([^']+)]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            //http://vod.afreecatv.com/PLAYER/STATION/36919620
            var title = document.getElementById('title_name').innerText;
            var video_url = window.location.href;
            var args = document.VodParameter;
            var api_url = 'http://stbbs.afreecatv.com/api/video/get_video_info.php?' + args;
            var headers = 'Referer: ' + window.location.href + '\r\nCookie: ' + document.cookie;
            var data = window.external.getHtmlCodeEx(api_url, headers);
            //找最后一条
            var p = new RegExp('>([^<]+\.m3u8)<', 'gi');
            while ((m = p.exec(data)) != null)
                video_url = m[1];

            document.body.innerHTML = 'title=\"' + title + '\",cr_video_url=' + video_url + '$' + document.body.innerHTML;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>