<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" referer="true" date="2020.09.29">
    <url><![CDATA[https?://(?:www\.)?zhenbuka\.com/vodplay/(?<id>[^/]+)]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA[thumbnail=([^,]+)]]></thumbnail>
    <duration><![CDATA[]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            var title = this.vod_name + ' ' + this.vod_part;
            var href = window.location.href;
            var url = 'https://www.zhenbuka.com/voddetail/' + href.match(/vodplay\/(\d+)/)[1];
            var html = window.external.getHtmlCode(url);
            var thumbnail = html.match(/data-original=\"([^\"]+)/) ? html.match(/data-original=\"([^\"]+)/)[1] : '';

            var video_url = '';
            html = document.body.innerHTML;
            var m = html.match(/=(http[^\"]+\.m3u8)/);
            if (!m && href.indexOf('-1-') != -1)
                href = href.replace('-1-', '-2-');
            html = window.external.getHtmlCode(href);
            m = html.match(/\"(http[^\"]+\.m3u8)/);
            //剧集https://www.zhenbuka.com/vodplay/26994-2-3/
            if (m)
                video_url = m[1];
            if (!video_url && html.indexOf('player_data') != -1 && html.indexOf('\"url\":') != -1) {
                url = 'https://api.nixingle.com/jiekou/zbk-bkby/jx.php?id=' + html.match(/player_data.*?\"url\":\"([^\"]+)/)[1];
                html = window.external.getHtmlCode(url, href);
                if (html.indexOf('u=\"') != -1) {
                    url = 'https://api.nixingle.com/jiekou/zbk-bkby/' + html.match(/u=\"([^\"]+)/)[1];
                    html = window.external.getHtmlCode(url, href);
                    if (html.indexOf('<video src=') != -1)
                        video_url = html.match(/<video\s+src=\"([^\"]+)/)[1];
                }
            }
            if (!video_url && href.indexOf('-2-') != -1) {
                href = href.replace('-2-', '-3-');
                html = window.external.getHtmlCode(href);
                m = html.match(/\"(http[^\"]+\.m3u8)/);
                if (m)
                    video_url = m[1];
            }
            if (!video_url)
                video_url = window.location.href;
            video_url = video_url.replace(/\\/g, '');
            document.body.innerHTML = 'title=\"' + title + '\",thumbnail=' + thumbnail + ',cr_video_url=' + video_url + '$';
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>