如何获取视频网站flv的真实地址 flv 视频地址视频 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 firefox安装NetVideoHunter插件就可以捕获视频地址了,不过广告什么的视频地址也会搞下来。。垃圾优酷,n多广告。 我想后台模拟浏览器给优酷发http请求,直接获取视频真实地址,我抓到了浏览器发的请求,现在问题是不知道那些请求怎么凑出来,有些字段试不出来猜不出用了什么加密方法比如有个sid字段mp4=221494448有一次请求中加密后是 940737754251710f3ece8而且每次请求加密出来的都不一样 最后一段加密没搞定: 抓到的:ep=4DXxCOeCN2kZSDE6mzkHoMb8nMWoP/hZw5698h7BLps=加密后的:ep=tyDhI85GLTQYUdtAcdGVirfin2wMMxXXm0DixV6KPadmyRLLLAZbauhT0XoGVFlYISCoLRj1d6iPeKYyEA0jOxDnL1%2FFHOeq4B%2FsR%2F%2B2ckmgU826jwkx45Nj69iCmSfwHoSmJqwx4aY%3D求帮忙。解密时下面几个不知道用哪个:key1=b3477626key2=1c5a2f270835040ck2=1b43a33236f102831 贴个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"; } } } Quote: 引用 5 楼 gdf87521 的回复:贴个youku的代码quote]谢谢这位童鞋。这个只能得到视频相关信息,得不到文件地址。接下来怎么做有眉目吗?? jHtmlArea HTML编辑器问题 能不能动态生成<script>标签呢? 怎样把照片和文字加载到新的网页上?特急请赐教! IE中Internet选项中设置里的"自动"是什么意思? 求一个正则,得到字符串中的第一个数字 请问有没有办法用javascript方法控制表的单元格背景?100分!!!拜托各位了 两个数组比较(算法) 怎样算最优化! 如何将字符型的变量变成整型的? extjs fileuploadfield IE 兼容 Microsoft JScript 运行时错误: 对象不支持此属性或方法 关于readonly与spry验证文本域的问题 定义浏览器滚动条的问题
猜不出用了什么加密方法比如有个sid字段
mp4=
221494448
有一次请求中加密后是 940737754251710f3ece8
而且每次请求加密出来的都不一样
ep=4DXxCOeCN2kZSDE6mzkHoMb8nMWoP/hZw5698h7BLps=加密后的:
ep=tyDhI85GLTQYUdtAcdGVirfin2wMMxXXm0DixV6KPadmyRLLLAZbauhT0XoGVFlYISCoLRj1d6iPeKYyEA0jOxDnL1%2FFHOeq4B%2FsR%2F%2B2ckmgU826jwkx45Nj69iCmSfwHoSmJqwx4aY%3D求帮忙。解密时下面几个不知道用哪个:
key1=b3477626
key2=1c5a2f270835040c
k2=1b43a33236f102831
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";
}
}
}