<?xml version="1.0" encoding="utf-8"?>
<parser delay="500" crpj="true" unescape="false" date="2020.08.27">
    <url><![CDATA[https?://(?:www\.)?instagram\.com/\w+/(?<id>[^/]+)]]></url>
    <title><![CDATA[title":"([^"]+)]]></title>
    <thumbnail><![CDATA[thumbnail_src":"([^"]+)]]></thumbnail>
    <duration><![CDATA[video_duration":([^,]+)]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            //其最后一个%2F不能做/转义，否则引起签名验证错误
            var html = document.getElementsByTagName('html')[0].innerHTML;
            if (document.getElementsByTagName('video').length == 0)
                html = window.external.getHtmlCode(window.external.url);
            var m = html.match(/video_url\":\"([^\"]+)/) || html.match(/display_url\":\"([^\"]+)/);
            var video_url = m ? m[1]: window.external.url
            document.body.innerHTML = 'cr_video_url=' + video_url + '$' + html;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>