<?xml version="1.0" encoding="utf-8"?>
<parser delay="2500" crpj="true" date="2019.10.11">
    <url><![CDATA[https?://baike\.baidu\.com/item/(?<id>[^/]+)]]></url>
    <title><![CDATA[data-lemmatitle="([^"]+)"]]></title>
    <thumbnail><![CDATA[background-image:.*?src=([^"]+)"]]></thumbnail>
    <duration><![CDATA[duration=([^&]+)&]]></duration>
    <mediaUrl><![CDATA[<video[^>]+\bsrc="([^"]+)"]]></mediaUrl>
    <headers><![CDATA[User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko]]></headers>
    <jsCode><![CDATA[
        try {
            //https://baike.baidu.com/item/%E7%99%BE%E5%90%88/7886?fr=aladdin
            var lid = window.location.href.match(/\/(\d+)/)[1];
            var api_url = 'https://baike.baidu.com/api/wikisecond/lemmasecond?lemmaId=' + lid;
            var data = window.external.getHtmlCode(api_url, window.location.href);
            var m = data.match(/\"([^\"]+\.m3u8)\"/) || data.match(/\"([^\"]+\.mp4)\"/);
            if (m)
                document.body.innerHTML = '<video src=\"' + m[1].replace(/\\/g, '') + '\" />$' + document.body.innerHTML;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>