Example #1
0
        public VideoInfo GetInfo(String url)
        {
            String vid = strUtil.TrimStart(url, "http://www.tudou.com/programs/view/").TrimEnd('/');

            String flashUrl = string.Format("http://www.tudou.com/v/{0}/v.swf", vid);

            VideoInfo vi = new VideoInfo();

            vi.PlayUrl  = url;
            vi.FlashId  = vid;
            vi.FlashUrl = flashUrl;

            try {
                String pageBody = PageLoader.Download(url);

                Match  mt    = Regex.Match(pageBody, "<title>([^<]+?)</title>");
                String title = VideoHelper.GetTitle(mt.Groups[1].Value);

                Match  m      = Regex.Match(pageBody, "thumbnail[^']+?'([^']+?)'");
                String picUrl = m.Groups[1].Value;

                vi.Title  = title;
                vi.PicUrl = picUrl;

                return(vi);
            }
            catch (Exception ex) {
                logger.Error("getUrl=" + url);
                logger.Error(ex.Message);

                return(vi);
            }
        }
Example #2
0
        public VideoInfo GetInfo(String url)
        {
            String vid = strUtil.TrimStart(url, "http://v.ku6.com/show/");

            vid = strUtil.TrimEnd(vid, ".html");

            String flashUrl = string.Format("http://player.ku6.com/refer/{0}/v.swf", vid);

            VideoInfo vi = new VideoInfo();

            vi.PlayUrl  = url;
            vi.FlashUrl = flashUrl;
            vi.FlashId  = vid;

            try {
                String pageBody = PageLoader.Download(url);

                Match  mt    = Regex.Match(pageBody, "<title>([^<]+?)</title>");
                String title = VideoHelper.GetTitle(mt.Groups[1].Value);

                Match  m      = Regex.Match(pageBody, "<span class=\"s_pic\">([^<]+?)</span>");
                String picUrl = m.Groups[1].Value;

                vi.Title  = title;
                vi.PicUrl = picUrl;

                return(vi);
            }
            catch (Exception ex) {
                logger.Error("getUrl=" + url);
                logger.Error(ex.Message);
                return(vi);
            }
        }
Example #3
0
        public VideoInfo GetInfo(String url)
        {
            String vid = strUtil.TrimStart(url, "http://v.youku.com/v_show/id_");

            vid = strUtil.TrimEnd(vid, ".html");

            String flashUrl = string.Format("http://player.youku.com/player.php/sid/{0}/v.swf", vid);

            VideoInfo vi = new VideoInfo();

            vi.PlayUrl  = url;
            vi.FlashUrl = flashUrl;
            vi.FlashId  = vid;

            try {
                String pageBody = PageLoader.Download(url);

                Match  mt    = Regex.Match(pageBody, "<title>([^<]+?)</title>");
                String title = VideoHelper.GetTitle(mt.Groups[1].Value);

                Match m = Regex.Match(pageBody, "pic=(http://[^:]+?.ykimg.com.+?)\"");

                String picUrl = m.Groups[1].Value;

                vi.Title  = title;
                vi.PicUrl = picUrl;

                return(vi);
            }
            catch (Exception ex) {
                logger.Error("getUrl=" + url);
                logger.Error(ex.Message);
                return(vi);
            }
        }
Example #4
0
        public VideoInfo GetInfo(String url)
        {
            String turl = strUtil.TrimStart(url, "http://");

            turl = strUtil.TrimStart(turl, "www.56.com");
            turl = strUtil.TrimEnd(turl, ".html");
            turl = turl.TrimStart('/');
            String[] arrItem = turl.Split('/');

            String vid      = strUtil.TrimStart(arrItem[1], "v_");
            String flashUrl = string.Format("http://player.56.com/v_{0}.swf", vid);

            VideoInfo vi = new VideoInfo();

            vi.PlayUrl  = url;
            vi.FlashId  = vid;
            vi.FlashUrl = flashUrl;

            try {
                String pageBody = PageLoader.Download(url);
                Match  mt       = Regex.Match(pageBody, "<title>([^<]+?)</title>");
                String title    = VideoHelper.GetTitle(mt.Groups[1].Value);

                String pattern = "\"img\":\"([^\"]+?)\"";

                Match  m      = Regex.Match(pageBody, pattern);
                String picUrl = m.Groups[1].Value;
                picUrl = picUrl.Replace("\\", "").Trim();

                vi.Title  = title;
                vi.PicUrl = picUrl;

                return(vi);
            }
            catch (Exception ex) {
                logger.Error("getUrl=" + url);
                logger.Error(ex.Message);

                return(vi);
            }
        }