本地如何下载超清爱奇艺无水印mp4视频(持续更新)
使用教程
用浏览器打开你想下载的视频页面,按F12打开开发者工具,
在console界面执行一下代码(复制后按回车执行)后会自动下载视频的m3u8文件,
然后用m3u8下载工具下载即可。
爱奇艺1080P_H264_高帧率
javascript:eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 7=8 U();7.V("W","y://X.t.u/z/Y/Z.z",5);7.10=6(){3 a=4.v("A");a.B=7.11;4.C("D")[0].E(a)};7.12(9);6 k(a){3 b=4.13.F("; ");14(3 i=0;i<b.15;i++){3 c=b[i].F("=");l(a==c[0])m G(c[1])}m 9}6 16(a,b){3 c=8 17(\'(^|&)\'+a+\'=([^&]*)(&|$)\',\'i\');3 r=b.18(c);l(r!=9){m G(r[2])}m 9}3 n=j.19.H.w("1a.t.u")!=-1?"1b":"1c";3 o=1d.1e.1f.I.1g.I.o;3 x="/1h/1i?J="+o.J+"&1j=1k&K="+o.K+"&n="+n+"&1l=0&1m=1&1n="+k("1o")+"&1p=1q&1r=0&1s="+k("1t")+"&1u=0&d=0&s=&1v=&1w=&1x=&1y=1&1z=0&1A=0&1B="+k("1C")+"&1D=1E&1F=0&1G=2&1H="+(8 1I()).1J()+"&1K=a&1L=0&1M=1N&1O=L&1P=1";j.M="y://1Q.N.t.u"+x+"&1R="+1S(x);O(j.M);6 O(a){3 b=4.C("D")[0];3 c=4.v("A");c.n=a;b.E(c)}6 L(e){3 i=e.1T.1U.N;i.1V(6(a,b){l(a.1W){3 c=a.P;3 d=8 1X([c],{1Y:"B/1Z"});3 e=20.21(d);3 f=(4.p.w("-")!=-1?4.p.22(0,4.p.w("-")):4.p.Q(/\\s/,""))+"q"+a.23+"q"+(a.24==2?"25":"26")+"q"+4.27("28-29-2a")[0].2b.Q(/:/,".")+"q"+(a.2c/R/R).2d(2)+"2e.P";3 g=4.v("a");g.H=e;g.2f=f;g.2g.2h="2i";3 h;l(j.S){h=8 S("T")}2j{h=4.2k("2l");h.2m("T",2n,5,j,0,0,0,0,0,5,5,5,5,0,9)}g.2o(h)}})}',62,149,'|||var|document|false|function|req1|new|null||||||||||window|getCookie|if|return|src|movieinfo|title|_|||iqiyi|com|createElement|indexOf|params|https|js|script|text|getElementsByTagName|head|appendChild|split|unescape|href|engine|tvid|vid|NILAODA|dashUrl|video|loadScript|m3u8|replace|1024|MouseEvent|click|XMLHttpRequest|open|GET|static|common|f6a3054843de4645b34d205a9f377d25|onload|responseText|send|cookie|for|length|getQueryString|RegExp|match|location|tw|03020031010010000000|03020031010000000000|playerObject|_player|package|adproxy|jp|dash|bid|610|vt|rs|uid|P00003|ori|pcw|ps|k_uid|QC005|pt|lid|cf|ct|k_tag|ost|ppt|dfp|__dfp|locale|zh_cn|k_err_retries|qd_v|tm|Date|getTime|qdy|qds|k_ft1|706504940322820|callback|ut|cache|vf|cmd5x|data|program|forEach|_selected|Blob|type|plain|URL|createObjectURL|substring|scrsz|code|H264|H265|getElementsByClassName|iqp|time|dur|innerText|vsize|toFixed|MB|download|style|display|none|else|createEvent|MouseEvents|initMouseEvent|true|dispatchEvent'.split('|'),0,{}))
2022/06/22 更新
目前网页最高清晰度, 高码率1080P/24fps(650)
var download = function (text, filename, type) {
let b = new Blob([text], {
type: type || 'text/plain'
});
let a = document.createElement("a");
a.href = URL.createObjectURL(b);
a.setAttribute("download", filename);
a.click();
};
var formatTime = function(dur) {
var date = new Date(0);
date.setSeconds(dur);
return date.toISOString().substr(11, 8).replace(/:/,"h").replace(/:/,"m")+"s";
};
var importCmd5xAsync = async function() {
let jsCode = await fetch("https://static.iqiyi.com/js/common/f6a3054843de4645b34d205a9f377d25.js").then(resp => resp.text());
let script = document.createElement("script");
script.text = jsCode;
document.getElementsByTagName("head")[0].appendChild(script);
};
var getCookie = function (sName) {
var aCookie = document.cookie.split("; ");
for (var i = 0; i < aCookie.length; i++) {
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
};
var doRequestAsync = async function(lid, ct, cf) {
let movieinfo = playerObject._player.package.engine.adproxy.engine.movieinfo;
let src = "01010031010000000000";
let host = "https://cache.video.iqiyi.com";
let params = "/dash?tvid=" + movieinfo.tvid
+ "&bid=800&vid=" + movieinfo.vid
+ "&src=" + src + "&vt=0&rs=1&uid=" + getCookie("P00003")
+ "&ori=pcw&ps=0&k_uid=" + getCookie("QC005")
+ "&pt=0&d=0&s=&lid=" + lid + "&ct=" + ct + "&cf=1&k_tag=1&ost=0&ppt=0&dfp=" + getCookie("__dfp")
+ "&locale=zh_cn&k_err_retries=0&qd_v=2&tm=" + (new Date()).getTime()
+ "&qdy=a&qds=0&k_ft1=740530597658614&k_ft2=2147483647&k_ft6=3859108094"
+ "&fr_600=60__60_60__&fr_860=_____&k_ft4=1732989035757060&agent_type=21"
+ "&sver=2&k_ver=13.5.0&k_ft7=163495&&k_ft5=41&k_ft8=_&k_err_retries=0"
+ "&ut=4&ut=5&ut=14&ut=17&ut=54&pano264=600&pano265=600&pre=0&fv=2";
let api = host + params + "&vf=" + cmd5x(params);
return await fetch(api,{credentials: 'include'}).then(resp => resp.json());
};
var ndIqyAsync = async function() {
await importCmd5xAsync();
let info = (await doRequestAsync()).data.program.video.sort((a,b)=>b.bid-a.bid)[0];
let m3u8Content = info.m3u8;
var title = "";
try{
title = document.querySelector('h1.player-title a.title-link[title]')['title'] + "_" + document.querySelector('h1.player-title em').innerText + "_" + info.scrsz + "_" + (info.code == 2 ? "H264" : "H265") + "_" + formatTime(info.duration) + "_" + (info.vsize / 1024 / 1024).toFixed(2) + "MB";
} catch(err){
title = document.title + "_" + info.scrsz + "_" + (info.code == 2 ? "H264" : "H265") + "_" + formatTime(info.duration) + "_" + (info.vsize / 1024 / 1024).toFixed(2) + "MB";
}
if(m3u8Content && m3u8Content!="") download(m3u8Content.replaceAll(/http.*?qiyi.com/g,"http://data.video.iqiyi.com"), title + ".m3u8");
else alert("解析失败!");
};
ndIqyAsync();
爱奇艺音轨下载
var download = function (text, filename) {
let b = new Blob([text], {
type: 'text/plain'
});
let a = document.createElement("a");
a.href = URL.createObjectURL(b);
a.setAttribute("download", filename);
a.click();
};
var importCmd5xAsync = async function() {
let jsCode = await fetch("https://static.iqiyi.com/js/common/f6a3054843de4645b34d205a9f377d25.js").then(resp => resp.text());
let script = document.createElement("script");
script.text = jsCode;
document.getElementsByTagName("head")[0].appendChild(script);
};
var getCookie = function (sName) {
var aCookie = document.cookie.split("; ");
for (var i = 0; i < aCookie.length; i++) {
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
};
var doRequestAsync = async function(lid, ct, cf) {
let movieinfo = playerObject._player.package.engine.adproxy.engine.movieinfo;
let src = "01010031010000000000";
let host = "https://cache.video.iqiyi.com";
let params = "/dash?tvid=" + movieinfo.tvid
+ "&bid=300&vid=" + movieinfo.vid
+ "&src=" + src + "&vt=0&rs=1&uid=" + getCookie("P00003")
+ "&ori=pcw&ps=0&k_uid=" + getCookie("QC005")
+ "&pt=0&d=0&s=&lid=" + lid + "&ct=" + ct + "&cf=" + (cf == "aac" ? "2" : "1") + "&k_tag=1&ost=0&ppt=0&dfp=" + getCookie("__dfp")
+ "&locale=zh_cn&k_err_retries=0&qd_v=2&tm=" + (new Date()).getTime()
+ "&qdy=a&qds=0&k_ft1=740531601218477&k_ft4=1162183859249156&k_ft5=1&ut=1&ut=5";
let api = host + params + "&vf=" + cmd5x(params);
return await fetch(api,{credentials: 'include'}).then(resp => resp.json());
};
var ndIqyAsync = async function() {
if (audioTracks) audioTracks = undefined;
var audioTracks = [];
await importCmd5xAsync();
var json = await doRequestAsync();
var info = json.data.program.audio;
info.forEach(function (item, index) {
let _track = {};
_track.bid = item.bid;
_track.name = item.name;
_track.cf = item.cf;
_track.ct = item.ct;
_track.lid = item.lid;
audioTracks.push(_track);
});
audioTracks.sort((a1, a2) => {
return (a2.name < a1.name ? 1 : (a2.name == a1.name ? 0 : -1)) + (a2.bid - a1.bid);
});
let p = "";
audioTracks.forEach(function (item, index) {
p += `\r\n[${index}]: {${item.name || ""}_${item.bid}_${item.cf}}`;
});
let _input = prompt("请选择音轨" + p);
if (!_input) return;
let _select = Number(_input);
let _lid = audioTracks[_select].lid;
let _ct = audioTracks[_select].ct;
let _cf = audioTracks[_select].cf;
var json = await doRequestAsync(_lid, _ct, _cf);
var info = json.data.program.audio.find(a=>a._selected);
var aSize = 0;
var fs = info.fs;
var content = "#EXTM3U\n";
var prefix = "https://data.video.iqiyi.com/videos";
let results = fs.map(async fs_i => {
let url = fs_i.l;
aSize += fs_i.b;
let api = prefix + url;
let t = "";
if(json.data.boss_ts){
t = json.data.boss_ts.data.t;
}
let vid = playerObject._player.package.engine.adproxy.engine.movieinfo.vid;
let su = getCookie("QC005");
api = prefix + url + "&t=" + t + "&vid=" + vid
+ "&QY00001=" + /qd_uid=(\d+)/g.exec(url)[1] + "&su="
+ su + "&ib=4&ibt=" + cmd5x(t + /\/(\w{10,})/g.exec(url)[1]) + "&ptime=0";
let _j = await fetch(api).then(resp => resp.json());
return "#EXTINF:"+(fs_i.d/1000).toFixed(2)+"\n" + _j["l"];
});
let urls = await Promise.all(results);
content += urls.join('\n');
content += "\n#EXT-X-ENDLIST";
var title = "";
try {
title = document.querySelector('h1.player-title a.title-link[title]')['title'] + "_" + document.querySelector('h1.player-title em').innerText + `_${(info.name || "")}_${info.cf}_` + (aSize / 1024 / 1024).toFixed(2) + "MB.m3u8";
} catch (error) {
title = document.title + `_${(info.name || "")}_${info.cf}_` + (aSize / 1024 / 1024).toFixed(2) + "MB.m3u8";
}
download(content, title);
};
ndIqyAsync();
腾讯视频
try {
var a = prompt(PLAYER._DownloadMonitor.context.dataset.title, PLAYER._DownloadMonitor.context.dataset.ckc ? PLAYER._DownloadMonitor.context.dataset.currentVideoUrl : PLAYER._DownloadMonitor.context.dataset.currentVideoUrl.replace(/:.*qq.com/g, "://defaultts.tc.qq.com/defaultts.tc.qq.com"));
} catch (error) {
if(__PLAYER__.currentVideoInfo.config.chachaParam != null) {
alert("不支持CHACHA加密");
} else {
var a = prompt(__PLAYER__.tvplayConfig.playTitle, __PLAYER__.currentVideoInfo.loadingUrl.replace(/:.*qq.com/g, "://defaultts.tc.qq.com/defaultts.tc.qq.com"));
}
}
共有 0 条评论