解决方案 »

  1.   

    firefox安装NetVideoHunter插件就可以捕获视频地址了,不过广告什么的视频地址也会搞下来。。垃圾优酷,n多广告。
      

  2.   

    我想后台模拟浏览器给优酷发http请求,直接获取视频真实地址,我抓到了浏览器发的请求,现在问题是不知道那些请求怎么凑出来,有些字段试不出来
    猜不出用了什么加密方法比如有个sid字段
    mp4=
    221494448
    有一次请求中加密后是 940737754251710f3ece8
    而且每次请求加密出来的都不一样
      

  3.   

    最后一段加密没搞定: 抓到的:
    ep=4DXxCOeCN2kZSDE6mzkHoMb8nMWoP/hZw5698h7BLps=加密后的:
    ep=tyDhI85GLTQYUdtAcdGVirfin2wMMxXXm0DixV6KPadmyRLLLAZbauhT0XoGVFlYISCoLRj1d6iPeKYyEA0jOxDnL1%2FFHOeq4B%2FsR%2F%2B2ckmgU826jwkx45Nj69iCmSfwHoSmJqwx4aY%3D求帮忙。解密时下面几个不知道用哪个:
    key1=b3477626
    key2=1c5a2f270835040c
    k2=1b43a33236f102831
      

  4.   

    贴个youku的代码打开 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Net;
    using System.Text;
    using System.Text.RegularExpressions;namespace DCC.UI.Common
    {
        public class YouKuApiHelper
        {
            private string videoApiUrl = "http://v.youku.com/player/getPlayList/VideoIDS/{0}";
            private string _url;
            public YouKuApiHelper(string url)
            {
                this._url = url;
            }        private bool GetVideoId(ref string videoId)
            {
                Regex regShow = new Regex(@"^http:\/\/v\.youku\.com\/v_show\/id_([\w\d+_-]*)\.html|^http:\/\/v\.youku\.com\/v_show\/id_([\w\d+_-]*)=\.html", RegexOptions.IgnoreCase);
                Match mShow = regShow.Match(_url);
                if (mShow.Success)
                {
                    videoId = mShow.Groups[1].Value;//Groups[0]為整個匹配對象(這裡是_url),Groups[1]才是第一個括號裡匹配的
                    return true;
                }
                else
                {
                    Regex regList = new Regex(@"^http:\/\/v\.youku\.com\/v_playlist", RegexOptions.IgnoreCase);
                    if (regList.IsMatch(_url))
                    {
                        try
                        {
                            WebClient webClient = new WebClient();
                            string youkuHtml = Encoding.ASCII.GetString(webClient.DownloadData(_url));
                            Regex regHtml = new Regex(@"(?is)var\s+(videoId2)+?\s*=\s*'([\w-]+)'\s*;", RegexOptions.IgnoreCase);
                            Match mHtml = regHtml.Match(youkuHtml);
                            if (mHtml.Success)
                            {
                                videoId = mHtml.Groups[2].Value;
                                return true;
                            }
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }
                    }
                }
                return false;
            }
            /// <summary>
            /// 根據youku的視頻URL分析再請求其API獲取視頻信息
            /// </summary>
            /// <returns></returns>
            public string GetVideoInfo()
            {
                try
                {
                    string videoId = string.Empty;
                    if (GetVideoId(ref videoId))
                    {
                        WebClient webClient = new WebClient();
                        string videoInfo = Encoding.ASCII.GetString(webClient.DownloadData(string.Format(videoApiUrl, videoId)));
                        return videoInfo;
                    }
                    else
                    { return "error"; }
                }
                catch (Exception ex)
                {
                    return "error";
                }
            }
        }
      

  5.   

    Quote: 引用 5 楼 gdf87521 的回复:

    贴个youku的代码
    quote]谢谢这位童鞋。这个只能得到视频相关信息,得不到文件地址。
    接下来怎么做有眉目吗??