Skip to content

Commit 9740269

Browse files
author
Taois
committed
fix:修复几个音乐源
1 parent 9d49e99 commit 9740269

File tree

5 files changed

+121
-78
lines changed

5 files changed

+121
-78
lines changed

spider/catvod/嗷呜动漫[漫].js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ title: '嗷呜动漫', author: '小可乐/v6.1.1'
44
"ext": {
55
"host": "xxxx", //站点网址
66
"timeout": 6000 //请求超时,单位毫秒
7-
}
7+
}
8+
@header({
9+
searchable: 1,
10+
filterable: 1,
11+
quickSearch: 1,
12+
title: '嗷呜动漫[漫]',
13+
lang: 'cat'
14+
})
815
*/
916
import {Crypto} from 'assets://js/lib/cat.js';
1017

spider/js/DJ音乐[听].js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,40 @@
1212
*/
1313

1414
var rule = {
15-
title:'DJ音乐',
16-
host:'http://www.djuu.com',
17-
homeUrl:'/exclusive/115_1.html',
18-
url:'/djlist/fyclass_fypage.html',
19-
searchUrl:'/search?musicname=**',
15+
title: 'DJ音乐',
16+
host: 'http://www.djuu.com',
17+
homeUrl: '/exclusive/115_1.html',
18+
url: '/djlist/fyclass_fypage.html',
19+
searchUrl: '/search?musicname=**',
2020
author: 'EylinSir',
2121
logo: 'https://pic.289.com/up/2023-12/20231219154340126.png',
2222
hikerListCol: 'icon_4',
23-
searchable:2,
24-
quickSearch:0,
23+
searchable: 2,
24+
quickSearch: 0,
2525
class_name: '迪高串烧&慢摇串烧&慢歌串烧&中文Remix&外文Remix&HOUSE&HOUSE&霓虹风格&Mashup&中文DISCO&外文DISCO',
2626
class_url: '1&2&3&4&5&6&7&8&9&10',
27-
headers:{
28-
'User-Agent':'PC_UA'
27+
headers: {
28+
'User-Agent': 'PC_UA'
2929
},
30-
timeout:5000,
31-
limit:6,
32-
double:false,
33-
play_parse:true,
34-
lazy: async function() {
30+
timeout: 5000,
31+
limit: 6,
32+
double: false,
33+
play_parse: true,
34+
lazy: async function () {
3535
let {input} = this;
36+
log("input:", input);
37+
let html = await request(input);
38+
// log(html)
39+
let music = html.match(/var\s+music\s*=\s*(\{[\s\S]*?\})/)[1];
40+
music = JSON5.parse(music);
41+
// log(music);
42+
// 算法来自:https://www.djuu.com/static/js/common.js
43+
input = urljoin(input, "//mp4.djuu.com/" + music.file + ".m4a");
44+
// log(input);
3645
return input;
3746
},
38-
推荐:'*',
39-
一级:'.list_musiclist tr:gt(0);a&&title;img&&src;.cor999:eq(1)&&Text;a&&href',
40-
二级:'*',
41-
搜索:'*;*;*;.sc_1&&Text;*',
47+
推荐: '*',
48+
一级: '.list_musiclist tr:gt(0);a&&title;img&&src;.cor999:eq(1)&&Text;a&&href',
49+
二级: '*',
50+
搜索: '*;*;*;.sc_1&&Text;*',
4251
}

spider/js/啊哈DJ[听].js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ var rule = {
2828
// console.log('input:', input);
2929
let html = await request(input);
3030
let _url = pdfh(html, 'video&&source&&src');
31-
return {parse: 0, url: _url, js: ''};
31+
return {
32+
parse: 0,
33+
url: _url,
34+
js: '',
35+
header: {
36+
referer: 'https://m.ahadj.com/',
37+
'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Mobile Safari/537.36'
38+
}
39+
};
3240
},
3341
推荐: '*',
3442
searchUrl: '/search/?key=**&page=fypage.html',

spider/js/音乐磁场[听].js

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,51 @@
1010
*/
1111

1212
var rule = {
13-
title: '音乐磁场',
14-
host: 'https://hifini.net/',
15-
url: '/forum-fyclass-fypage.htm?orderby=lastpid&follow=0',
16-
searchUrl: '/search-**-1-0-fypage.htm',
17-
class_parse: '.navbar-nav li;a&&Text;a&&href;forum-(.*/?).htm',
18-
searchable: 2,
19-
quickSearch: 0,
20-
filterable: 0,
21-
headers: {
22-
'User-Agent': 'MOBILE_UA',
23-
},
24-
play_parse: true,
25-
lazy: `
26-
let html = request(input);
13+
title: '音乐磁场',
14+
host: 'https://hifini.net/',
15+
url: '/forum-fyclass-fypage.htm?orderby=lastpid&follow=0',
16+
searchUrl: '/search-**-1-0-fypage.htm',
17+
class_parse: '.navbar-nav li;a&&Text;a&&href;forum-(.*/?).htm',
18+
searchable: 2,
19+
quickSearch: 0,
20+
filterable: 0,
21+
headers: {
22+
'User-Agent': 'MOBILE_UA',
23+
},
24+
play_parse: true,
25+
lazy: $js.toString(async () => {
26+
let html = await request(input);
2727

2828
// 1️⃣ 直链
29-
let m = html.match(/url:\\s*"(https?:[^"]+)"/);
30-
let playUrl = m ? m[1] : input;
29+
// let m = html.match(/url:\s*"(https?:[^"]+)"/);
30+
// let playUrl = m ? m[1] : input;
31+
const urlPropertyPattern = /url\s*:\s*['"](https?:\/\/[^'"]+)['"]/gi;
32+
const matches = [...html.matchAll(urlPropertyPattern)];
33+
const urlValues = matches.map(match => match[1]);
34+
console.log(urlValues);
35+
let playUrl = urlValues[0] || input;
3136

3237
// 2️⃣ 歌词
33-
let lyric = [];
34-
let ps = html.match(/<p>(.*?)<\\/p>/g) || [];
35-
for(let p of ps){
36-
let t = p.replace(/<[^>]+>/g,'').trim();
37-
if(!t) continue;
38-
if(/下载链接|提取码|隐藏内容/.test(t)) break;
39-
lyric.push(t);
40-
}
38+
let lyric = [];
39+
let ps = html.match(/<p>(.*?)<\/p>/g) || [];
40+
for (let p of ps) {
41+
let t = p.replace(/<[^>]+>/g, '').trim();
42+
if (!t) continue;
43+
if (/||/.test(t)) break;
44+
lyric.push(t);
45+
}
4146

42-
input = {
43-
parse: 0,
44-
url: playUrl,
45-
lyric: lyric.join('\\n')
46-
};
47-
`,
48-
limit: 6,
49-
double: true,
50-
推荐: '.cbox_list;*;*;*;*;*',
51-
一级: 'ul.list-unstyled li:gt(2);.subject&&Text;img&&src;.media-body&&Text;.subject a&&href',
52-
二级: '*',
53-
搜索: '*',
47+
input = {
48+
parse: 0,
49+
url: playUrl,
50+
lyric: lyric.join('\n')
51+
};
52+
return input
53+
}),
54+
limit: 6,
55+
double: true,
56+
推荐: '.cbox_list;*;*;*;*;*',
57+
一级: 'ul.list-unstyled li:gt(2);.subject&&Text;img&&src;.media-body&&Text;.subject a&&href',
58+
二级: '*',
59+
搜索: '*',
5460
}

spider/js_dr2/爱上听书[听].js

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,42 @@
1010
*/
1111

1212
var rule = {
13-
title:'爱上你听书网',
14-
host:'https://www.230ts.net',
15-
url:'/sort/fyclass/fypage.html',
16-
searchUrl:'/search.html?searchtype=name&searchword=**&page=fypage',
17-
searchable:2,
18-
quickSearch:0,
19-
headers:{
20-
'User-Agent':'PC_UA'
13+
title: '爱上你听书网',
14+
host: 'https://www.230ts.net',
15+
url: '/sort/fyclass/fypage.html',
16+
searchUrl: '/search.html?searchtype=name&searchword=**&page=fypage',
17+
searchable: 2,
18+
quickSearch: 0,
19+
headers: {
20+
'User-Agent': 'PC_UA'
2121
},
22-
timeout:5000,
22+
timeout: 5000,
2323
class_parse: '.nav-ol&&li:gt(0):lt(6);a&&Text;a&&href;.*/(\\w+).html',
24-
play_parse:true,
25-
lazy:'js:input=input.replace("www","wap")',
26-
limit:6,
27-
推荐:'#myTab_Content1&&li;.tab-book-title&&Text;*;.tab-book-author&&Text;*',
28-
一级:'ul.list-works&&li;.list-book-dt--span&&Text;.lazy&&data-original;.book-author:eq(2)&&a&&Text;a&&href',
29-
二级:{
30-
title:'.book-cover&&alt;.book-info&&dd--span:eq(1)&&Text',
31-
img:'.book-cover&&src',
32-
desc:'.book-info&&dd:eq(4)&&Text;;;.book-info&&dd--span:eq(3)&&Text;.book-info&&dd--span:eq(2)&&Text',
33-
content:'.book-des&&Text',
34-
tabs:'.playlist-top&&h2',
35-
lists:'#playlist:eq(#id)&&li',
24+
play_parse: true,
25+
lazy: $js.toString(() => {
26+
let html = request(input);
27+
let src = pd(html, 'iframe#play&&src', input);
28+
log('src:' + src);
29+
html = request(src);
30+
const regex = /mp3\s*:\s*'([^']+)'/;
31+
const match = html.match(regex);
32+
if (match && match[1].includes('auth_key')) {
33+
// 替换变量部分为 .mp3.
34+
src = match[1].replace(/'([^']*)'\s*\+\s*[a-zA-Z_$][a-zA-Z0-9_$]*\s*\+\s*'([^']*)'/, '$1.mp3.$2');
35+
log('match src:' + src);
36+
}
37+
input = src
38+
}),
39+
limit: 6,
40+
推荐: '#myTab_Content1&&li;.tab-book-title&&Text;*;.tab-book-author&&Text;*',
41+
一级: 'ul.list-works&&li;.list-book-dt--span&&Text;.lazy&&data-original;.book-author:eq(2)&&a&&Text;a&&href',
42+
二级: {
43+
title: '.book-cover&&alt;.book-info&&dd--span:eq(1)&&Text',
44+
img: '.book-cover&&src',
45+
desc: '.book-info&&dd:eq(4)&&Text;;;.book-info&&dd--span:eq(3)&&Text;.book-info&&dd--span:eq(2)&&Text',
46+
content: '.book-des&&Text',
47+
tabs: '.playlist-top&&h2',
48+
lists: '#playlist:eq(#id)&&li',
3649
},
37-
搜索:'*',
50+
搜索: '*',
3851
}

0 commit comments

Comments
 (0)