function issupport(url)
    if url:match("^http://video.baomihua.com/") then return true end
    if url:match("^http://p.pomoho.com/") then return true end
    return false
end

function analyze(url)
    --播放页面 http://video.baomihua.com/11262678/17889217
    --         http://p.pomoho.com/play/dF9jbHN4eXgvMTc5NzEyNzU$
    --信息页面 http://play.pomoho.com/getvideourl.aspx?flvid=17889217
    --下载地址 http://v171.pomoho.com/pomoho_video/201112/17889217.flv
    local json = require('json')
    require('common')
    local result = {}
    local page = idown.requesturl(url)

    local vid = page:match('var flvid=(%d+)') or page:match('flvid=(%d+)')
    print('vid:',vid)
    
    local url2 = 'http://play.pomoho.com/getvideourl.aspx?flvid='..vid
    local page2 = idown.requesturl(url2,'','')
    print(page2)
    
    local params = urlparamdecode(page2)
    result.realurl = string.format('http://%s/pomoho_video/%s.flv', params.host, params.stream_name)
    print('realurl:', result.realurl)
    
    result.title = page:match('var videoTitle="([^"]*)"')
    if result.title then 
        result.title = urldecode(result.title) 
    else
        result.title = page:match("_title='([^']+)")
    end
    result.realname = result.title..'.flv'
    result.encode = 65001
    
    local ret = json:encode(result)
    print('ret:', ret)
    return 1, ret
end