<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" date="2020.01.06">
    <url><![CDATA[https?://(?:www\.)?kugou\.com/song/(?:(?<id>[^.]+)\.html?|#.*?hash=(?<id>[^&]+))]]></url>
    <title><![CDATA[audioName">([^<]+)]]></title>
    <thumbnail><![CDATA[this\.src=([^"]+)]]></thumbnail>
    <duration><![CDATA[timeLength":(\d+)]]></duration>
    <mediaUrl><![CDATA[url":\["([^"]+)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            var url = window.location.href;
            if (url.indexOf('#') != -1) {
                var hash = url.match(/hash=([^&]+)/)[1];
                var key = window.external.md5(hash + 'kgcloudv2');
                var api_url = 'http://trackercdn.kugou.com/i/v2/?cmd=25&pid=1&behavior=play&hash=' + hash + '&key=' + key;
                var data = window.external.getHtmlCode(api_url);
                jo = JSON.parse(data);
                data = JSON.stringify(jo);
                document.body.innerHTML = data + '$' + document.body.innerHTML;
                document.head.innerHTML = '';
            }
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>