<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" date="2020.01.04">
    <url><![CDATA[https?://(?:ys\.)?fgdgee\.live/index\.php/vod/play/id/(?<id>\d+)]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>
    <thumbnail><![CDATA[thumbnail=([^,]+)]]></thumbnail>
    <duration><![CDATA[]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            var title = document.body.innerHTML.match(/<h4[^>]+>([^<]+)/)[1];
            var ls = document.getElementsByClassName('active');
            if (ls.length != 0)
                title += '_' + ls[ls.length - 1].innerText;
            var url = window.external.url || window.location.href;
            var id = url.match(/id\/(\d+)/)[1];
            var detail_url = 'http://ys.fgdgee.live/index.php/vod/detail/id/' + id + '.html';
            var html = window.external.getHtmlCode(detail_url);
            var thumbnail = html.match(/data-original=\"([^\"]+)/)[1];
            var video_url = url;
            var m = document.body.innerHTML.match(/url=([^\"]+\.m3u8[^\"]*)/);
            if (m)
                var video_url = m[1];
            else {
                m = document.body.innerHTML.match(/\"([^\"]+vid=[^\"]+)/);
                if (m) {
                    var data_url = m[1].replace('ifr.php', 'glid.php');
                    html = window.external.getHtmlCode(data_url);
                    video_url = html.match(/url='([^']+)/)[1];
                }
            }
            document.body.innerHTML = 'title=\"' + title + '\",thumbnail=' + thumbnail + ',cr_video_url=' + video_url + '$';
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>