<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" referer="true" date="2020.11.30">
    <url><![CDATA[cen?tv\.cn/.*/(?<id>[^.]+)\.html?]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA[thumbnail=([^,]+)]]></thumbnail>
    <duration><![CDATA[duration=([^,]+)]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            //http://m.cetv.cn/p/373468.html
            var video_url = window.location.href;
            var thumbnail = '';
            var duration = 0;
            if (document.getElementsByTagName('iframe').length != 0) {
                var src = document.getElementsByTagName('iframe')[0].src;
                var sid = src.match(/sid=([^&]+)/)[1];
                var vid = src.match(/vid=([^&]+)/)[1];
                var thumbnail = decodeURIComponent(src.match(/thumb=([^&]+)/)[1]);
                var api_url = 'http://app.cetv.cn/video/player/video?sid=' + sid + '&vid=' + vid + '&type=video';
                var data = window.external.getHtmlCode(api_url);
                if (data) {
                    var jo = JSON.parse(data);
                    duration = jo.time;
                    video_url = jo.file.ed || jo.file.hd || jo.file.sd;
                }
            }
            document.body.innerHTML = 'title=\"' + document.title + '\",thumbnail=' + thumbnail + ',duration=' + duration + ',cr_video_url=' + video_url + '$';
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>