<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" date="2020.12.28">
    <url><![CDATA[https?://(?:\w+\.)?miguvideo\.com/.*?cid=(?<id>\d+)]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA[thumbnail=([^,]+)]]></thumbnail>
    <duration><![CDATA[duration=([^,]+)]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            var cid = window.external.url.match(/cid=(\d+)/)[1];
            if (window.external.url.indexOf('channelid=') != -1)
                cid = window.external.url.match(/channelid=.*?(\d{9})/)[1];
            var api_url = 'http://www.miguvideo.com/gateway/program/v2/cont/content-info/' + cid;
            var data = window.external.getHtmlCode(api_url);
            var thumbnail = '';
            var jo = JSON.parse(data);
            for (let k in jo.body.data.h5pics)
                thumbnail = jo.body.data.h5pics[k];

            api_url = 'http://webapi.miguvideo.com/gateway/playurl/v3/play/playurl?contId=' + cid + '&rateType=4%2C3';
            data = window.external.getHtmlCode(api_url);
            jo = JSON.parse(data);
            var title = jo.body.content.contName;
            var duration = jo.body.content.duration;
            var video_url = jo.body.urlInfo.url;
            //为&time转义计
            document.body.innerText = 'title=\"' + title + '\",thumbnail=' + thumbnail + ',duration=' + duration + ',cr_video_url=' + video_url + '$';
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>