<?xml version="1.0" encoding="utf-8"?>
<parser delay="1500" crpj="true" date="2021.01.13">
    <url><![CDATA[\w+\.sohu\.com/\w+/(?<id>[^.]+)]]></url>
    <title><![CDATA[<meta\s+content="([^"]+)"\s+property="og:title">]]></title>
    <thumbnail><![CDATA[<meta\s+content="([^"]+)"\s+property="og:image">]]></thumbnail>
    <duration><![CDATA[videoLength:\s+'([^']+)']]></duration>
    <mediaUrl><![CDATA[cr_video_url=([^\$]+)]]></mediaUrl>
    <ckSign><![CDATA[lastpassport]]></ckSign>
    <jsCode><![CDATA[
        try {
            //https://tv.sohu.com/v/MjAxNzExMDkvbjYwMDI0NzEwMi5zaHRtbA.html?qq-pf-to=pcqq.c2c
            //https://tv.sohu.com/v/dXMvMzI0MjUzNjQwLzIwODMxNzk1Ny5zaHRtbA==.html
            //https://film.sohu.com/album/1011756.html
            //http://m.tv.sohu.com/u/vw/216398579.shtml
            var video_url = window.location.href;
            if (this.vid) {
                var api_url = 'https://my.tv.sohu.com/play/videonew.do?vid=' + this.vid + '&ver=21&ssl=1&referer=' + window.location.href + '&t=' + Date.now();
                var data = window.external.getHtmlCode(api_url, window.location.href);
                var jo = JSON.parse(data);
                if (jo.data && jo.data.clipsURL.length != 0)
                    video_url = jo.data.clipsURL[0] || video_url;
            }
            //https://www.sohu.com/a/433001129_100011756?scm=1019.e000a.v1.0&spm=smpc.csrpage.news-list.1.1606879259685Gfeu22x&qq-pf-to=pcqq.group
            else if (document.getElementsByTagName('iframe').length != 0) {
                for (var i = 0; i <= document.getElementsByTagName('iframe').length - 1; i++) {
                    var iframe = document.getElementsByTagName('iframe')[i];
                    if (iframe.className == 'center-iframe')
                        video_url = iframe.src + '#ra';
                }
            }
            document.body.innerHTML = 'cr_video_url=' + video_url + '$' + document.body.innerHTML;
        }
        catch (ex) {
        }
    ]]></jsCode>
</parser>