目标站点 王派医学官网王派医学
脚本原理就是删除key链接中的playsafe
1.浏览器
2.配置好证书的Fiddler,可以看我b站视频【跟着新手学抓包】第003集如何配置中文版Fiddler_哔哩哔哩_bilibili
1.首先打开Fiddler,切换到FiddlerScript
2.在第一行加上这段代码
3.点击跳转:OnBeforeRequest
4.在OnBeforeRequest前面加上这段代码
5.在OnBeforeRequest里面加上这段代码
6.点击跳转:OnBeforeResponse
7.在OnBeforeReseponse里面加上这段代码
1.点击规则->捕获blv,前面有勾代表开启,没有代表关闭
2.切换到日志面板,右键->清除
3.登录网站,点击视频,地址自吐
4.将地址放到下载器
import
System.Text.RegularExpressions;
import
System.Text.RegularExpressions;
public static RulesOption(
"捕获blv"
)
BindPref(
"fiddlerscript.rules.BLV"
)
var m_isBLV: boolean
=
false;
public static RulesOption(
"捕获blv"
)
BindPref(
"fiddlerscript.rules.BLV"
)
var m_isBLV: boolean
=
false;
if
(m_isBLV && oSession.fullUrl.Contains(
"https://hls.videocc.net/playsafe"
) && oSession.fullUrl.Contains(
"key"
)){
oSession.fullUrl
=
oSession.fullUrl.Replace(
"/playsafe"
,"");
}
if
(m_isBLV && oSession.fullUrl.Contains(
"https://hls.videocc.net/playsafe"
) && oSession.fullUrl.Contains(
"key"
)){
oSession.fullUrl
=
oSession.fullUrl.Replace(
"/playsafe"
,"");
}
if
(m_isBLV){
if
(oSession.fullUrl.Contains(
"https://hls.videocc.net"
) && oSession.fullUrl.Contains(
"m3u8"
)){
oSession.utilDecodeResponse();
var body
=
oSession.GetResponseBodyAsString();
if
(body.IndexOf(
"#EXT-X-STREAM-INF"
)!
=
-
1
){
var m3u8Url
=
oSession.fullUrl;
var baseUrl
=
oSession.fullUrl.Substring(
0
,oSession.fullUrl.IndexOf(
".m3u8"
))
var r
=
new Regex(
'_(.*?desktop)'
);
FiddlerObject.log(body);
var mc
=
r.Match(body);
if
(mc.Groups[
1
].Value
=
=
""){
/
/
没有匹配到,不再执行后面的代码
FiddlerObject.log(
"[异常]:获取m3u8Url正则失败,请联系开发者"
);
return
;
}
var dUrl
=
mc.Groups[
1
].Value;
var m3u8Data
=
baseUrl
+
"_"
+
dUrl;
FiddlerObject.log(
"成功获取最高清晰度m3u8URL为:"
);
FiddlerObject.log(m3u8Data)
}
}
}
if
(m_isBLV && oSession.fullUrl.Contains(
"hls.videocc.net"
) && oSession.fullUrl.Contains(
"key?token"
) ){
FiddlerObject.log(Fiddler.Utilities.ByteArrayToString(oSession.ResponseBody))
var keyBytes
=
Fiddler.Utilities.ByteArrayToString(oSession.ResponseBody)
var base64Data
=
Convert.ToBase64String(oSession.ResponseBody)
FiddlerObject.log(
"base64:"
+
base64Data)
}
if
(m_isBLV){
if
(oSession.fullUrl.Contains(
"https://hls.videocc.net"
) && oSession.fullUrl.Contains(
"m3u8"
)){
oSession.utilDecodeResponse();
var body
=
oSession.GetResponseBodyAsString();
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课