<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" delegate="true" date="2025.04.05">
    <url><![CDATA[https?://(?:www\.)?news\.cn/.*/(?<id>[^.]+)\.html?]]></url>
    <title><![CDATA[title="([^"]+)"]]></title>s
    <thumbnail><![CDATA[thumbnail=([^,]*)]]></thumbnail>
    <duration><![CDATA[]]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^$]*)]]></mediaUrl>
    <jsCode><![CDATA[
        try {
            //url匹配须全，避免影响https://v.hinews.cn/xinwen/show-1506653.html这样的
            //https://www.news.cn/video/20231013/57ccb684ed3d40d8b8ccb9dfe92e86ea/c.html
            //https://www.news.cn/travel/20250321/b18d9d684c8d47958ea8a4931ca85731/c.html
            //https://www.news.cn/politics/20250323/12d850a2819149b499de602238cb1aa5/c.html
            //http://www.news.cn/20250324/ac2b3ab60fb448f39d218b8f585b15cb/c.html
            var html = getHtml(url).replace(/&amp;/g, '&');
            var title = html.match(/<title[^>]*>([^<]+)/)[1], thumbnail = '', video_url = '';
            var id = html.match(/contentid\"\s+content=\"([^\"]+)/) ? html.match(/contentid\"\s+content=\"([^\"]+)/)[1] : '';
            var base_url = url.substr(0, url.lastIndexOf('/')) + '/';
            //c.html
            if (id) {
                var api_url = base_url +  'c_' + id + '.json';
                var data = getHtml(api_url, url);
                title = data.match(/title\":\"([^\"]+)/) ? data.match(/title\":\"([^\"]+)/)[1] : title;
                thumbnail = data.match(/imageUrl\":\"([^\"]+)/) ? base_url + data.match(/imageUrl\":\"([^\"]+)/)[1] : thumbnail;
                video_url = data.match(/\"([^\"]+\.mp4)/) ? data.match(/\"([^\"]+\.mp4)/)[1] : video_url;
            }
            //https://www.news.cn/world/2023-10/11/c_1212287162.htm
            else if (html.match(/getPlayPage\?(uuid=[^&]+&vid=[^&]+)/)) {
                var args = html.match(/getPlayPage\?(uuid=[^&]+&vid=[^&]+)/)[1];
                var api_url = 'http://player.v.news.cn/api/v1/getConfigs?' + args;
                var data = getHtml(api_url, url);
                var jo = json(data);
                thumbnail = jo.result.videoInfos.poster;
                video_url = jo.result.videoInfos.src;
            }
            title = title.replace('-新华网', '');
            document.body.innerHTML = 'title=\"' + title + '\",thumbnail=' + thumbnail + ',cr_video_url=' + video_url + '$' + html;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>