最近在搜寻车载音乐,然后想到了清风DJ 里面的音乐都挺好的,所以想到写一个爬虫爬取资源然后下载,于是,便开启了音频源寻找之旅!
1、你需要有一个浏览器(这句话有点多余...)
2、JS调试工具
3、基础的编程
首先,随便找一个音乐网址
[HTML] 纯文本查看 复制代码 https://www.vvvdj.com/play/214245.html
然后F12调出控制台。进入→Network→F5刷新
然后搜索M3U8关键字
然后发现M3U8文件名就是网址里面的音乐ID
[HTML] 纯文本查看 复制代码 https://tspc.vvvdj.com/c1/2021/06/214245-d3d15d/214245.m3u8?upt=5a64be351625587199&news
之后搜素 214245 搜索到很多结果 然后一个一个看,源代码里面有很多JS代码
然后就在里面挨个找一下 注:我比较闲 所以这么找 我是笨蛋
然后我们发现一段有意思的代码
[HTML] 纯文本查看 复制代码 function DeCode() {
this.OO0O00OO00OO = function (a, b) {
return b > 0 ? a.substring(0, b) : null;
}, this.OO00OO0O00O0 = function (a, b) {
return a.length - b >= 0 && a.length >= 0 && a.length - b <= a.length ? a.substring(a.length - b, a.length) : null;
}, this.O0000OO0OO00O0 = function (a, b) {
var c, d, e, f, g, h, i, j, k = "";
for (c = 0; c < b.length; c++) {
k += b.charCodeAt(c).toString();
}
for (d = Math.floor(k.length / 5), e = parseInt(k.charAt(d) + k.charAt(2 * d) + k.charAt(3 * d) + k.charAt(4 * d) + k.charAt(5 * d)),
f = Math.round(b.length / 2), g = Math.pow(2, 31) - 1, h = parseInt(a.substring(a.length - 8, a.length), 16),
a = a.substring(0, a.length - 8), k += h; k.length > 10; ) {
k = (parseInt(k.substring(0, 10)) + parseInt(k.substring(10, k.length))).toString();
}
for (k = (e * k + f) % g, i = "", j = "", c = 0; c < a.length; c += 2) {
i = parseInt(parseInt(a.substring(c, c + 2), 16) ^ Math.floor(255 * (k / g))), j += String.fromCharCode(i),
k = (e * k + f) % g;
}
return j;
}, this.O0000OO0OO00O = function (a, b, c) {
return a.length >= 0 ? a.substr(b, c) : null;
}, this.O0O000000O0O0 = function (a) {
return a.length;
}, this.O000O0OO0O0OO = function (a,b) {
var h, i, j, k, l, m, n, o, p, c = b, d = this.O0O000000O0O0(c), e = d, f = new Array(), g = new Array();
for (l = 1; d >= l; l++) {
f[l] = this.O0000OO0OO00O(c, l - 1, 1).charCodeAt(0), g[e] = f[l], e -= 1;
}
for (h = "", i = a, m = this.OO0O00OO00OO(i, 2), i = this.OO00OO0O00O0(i, this.O0O000000O0O0(i) - 2),
l = 0; l < this.O0O000000O0O0(i); l += 4) {
j = this.O0000OO0OO00O(i, l, 4), "" != j && (b = this.OO0O00OO00OO(j, 1), k = (parseInt(this.OO00OO0O00O0(j, 3)) - 100) / 3,
m == this.O0000OO0OO00O0("a9ab044c634a", "O0000OO0OO00O") ? (n = 2 * parseInt(b.charCodeAt(0)),
o = parseInt(f[k]), p = n - o, h += String.fromCharCode(p)) : (n = 2 * parseInt(b.charCodeAt(0)),
o = parseInt(g[k]), p = n - o, h += String.fromCharCode(p)));
}
return h;
};
}
把这段代码粘贴到JS调试,发现可以成功加载。
但是你以为这就完了吗,不!代码找到了,参数没找到。但是我们看下面几行。
[HTML] 纯文本查看 复制代码 var x=new DeCode();
playurl=x.O000O0OO0O0OO('e0C2560259f265q271]274]277N283h286V289U304d310_316S319l325]328h337P340V3432352Q358:36143644367M376D388I391X394B403U406C409P412E415B418P433J436S442E445]4485451A460S469S472O484K490<505N514E526F529O538Q541=544a547T550W553_562^571a583Y586<592U595W598Q601J604g610Q613G6252631C6341637>6405643M646G6491652O658T661G667S670l679W697j703','FLybdfT0ijm95VolyocsojxdHQkXMIrfhbHNIpWXGpGXaSlp2xlW1gXFoJWunZ6mEA34Gd9TxtuK6ZcqITf3TsB86pfirPzYbzJvUxUlXPjdRVkg3BWV92xMQUBwSiul4e7KgIDAQjQKIVW1Op5GMpoVfI9cLDskNuRCIxn2bioV4tYB3P0G5bW14eoOh8dZs8nNHl7halg3CeVJuIfQqaiJkzYsqrI4RxsPbmdpmxjP9OFlPplblMZiipUKLqvojAEAOWDCmmtQoSx38ZcAQoMwgNSK61cNKjuAjmoxqq7Z4IUgwf0h2lkka7tXplXGarCS2FHBKOkKHzTQEd3JWhMv6oIck0BqT7FqmfOznkt8pN9EgPf3dTQLhXq1bGNQNcsx6YD58AZFUbZeYfs2CHsSVfiICeDi8F3e6J7EvYW5KTNjetehXEl0DTetomLx80k20rFSQYsxa4Cgzc9cq32z3NP2WU5C9OyM2ZiqQ7Nrh7m89Cgac57e1AmoZzG6');
// 播放全部
我们会发现,这段代码有两个参数。 但是上边加载出来的函数没有双参数的函数, 所以我们需要写一个函数,放到上边代码的下边。
[HTML] 纯文本查看 复制代码 function GetDataUrl(K1,k2) {
var x = new DeCode();
playurl = x.O000O0OO0O0OO(K1,k2);
return playurl;
}
然后加载JS代码,这时,再把之前的参数代入进去运行一下
我们发现,可以运行起来。结果也能获取出来。
至于参数怎么获取?
步骤:
1、取网页源代码(https://www.vvvdj.com/play/214245.html)
2、然后取中间文本
playurl=x.O000O0OO0O0OO('参数1','参数2');
第一组单引号里面是 参数1 第二组单引号是 参数2
3、引用JS代码,调用 GetDataUrl 函数→引用参数→成功
完整JS代码
[JavaScript] 纯文本查看 复制代码 function DeCode() {
this.OO0O00OO00OO = function (a, b) {
return b > 0 ? a.substring(0, b) : null;
}, this.OO00OO0O00O0 = function (a, b) {
return a.length - b >= 0 && a.length >= 0 && a.length - b <= a.length ? a.substring(a.length - b, a.length) : null;
}, this.O0000OO0OO00O0 = function (a, b) {
var c, d, e, f, g, h, i, j, k = "";
for (c = 0; c < b.length; c++) {
k += b.charCodeAt(c).toString();
}
for (d = Math.floor(k.length / 5), e = parseInt(k.charAt(d) + k.charAt(2 * d) + k.charAt(3 * d) + k.charAt(4 * d) + k.charAt(5 * d)),
f = Math.round(b.length / 2), g = Math.pow(2, 31) - 1, h = parseInt(a.substring(a.length - 8, a.length), 16),
a = a.substring(0, a.length - 8), k += h; k.length > 10; ) {
k = (parseInt(k.substring(0, 10)) + parseInt(k.substring(10, k.length))).toString();
}
for (k = (e * k + f) % g, i = "", j = "", c = 0; c < a.length; c += 2) {
i = parseInt(parseInt(a.substring(c, c + 2), 16) ^ Math.floor(255 * (k / g))), j += String.fromCharCode(i),
k = (e * k + f) % g;
}
return j;
}, this.O0000OO0OO00O = function (a, b, c) {
return a.length >= 0 ? a.substr(b, c) : null;
}, this.O0O000000O0O0 = function (a) {
return a.length;
}, this.O000O0OO0O0OO = function (a,b) {
var h, i, j, k, l, m, n, o, p, c = b, d = this.O0O000000O0O0(c), e = d, f = new Array(), g = new Array();
for (l = 1; d >= l; l++) {
f[l] = this.O0000OO0OO00O(c, l - 1, 1).charCodeAt(0), g[e] = f[l], e -= 1;
}
for (h = "", i = a, m = this.OO0O00OO00OO(i, 2), i = this.OO00OO0O00O0(i, this.O0O000000O0O0(i) - 2),
l = 0; l < this.O0O000000O0O0(i); l += 4) {
j = this.O0000OO0OO00O(i, l, 4), "" != j && (b = this.OO0O00OO00OO(j, 1), k = (parseInt(this.OO00OO0O00O0(j, 3)) - 100) / 3,
m == this.O0000OO0OO00O0("a9ab044c634a", "O0000OO0OO00O") ? (n = 2 * parseInt(b.charCodeAt(0)),
o = parseInt(f[k]), p = n - o, h += String.fromCharCode(p)) : (n = 2 * parseInt(b.charCodeAt(0)),
o = parseInt(g[k]), p = n - o, h += String.fromCharCode(p)));
}
return h;
};
}
function GetDataUrl(K1,k2) {
var x = new DeCode();
playurl = x.O000O0OO0O0OO(K1,k2);
return playurl;
}
由于本人不会Python,所以,附上易语言代码
易语言调用代码:
注:需要用到精易模块 (可百度)
源码:https://ehepls.lanzoui.com/iLsIOpywewh
成品腾讯哈勃查毒:https://habo.qq.com/file/showdetail?pk=ADcGYF1sB2AIOFs6U2Y%3D
对于不使用易语言的提供成品(上述源码V98link静态编译而来):https://ehepls.lanzoui.com/irPRlpywgfc
M3U8下载工具:https://ehepls.lanzoui.com/iz96upskide
|