|
| 1 | +/* |
| 2 | +@header({ |
| 3 | + searchable: 2, |
| 4 | + filterable: 0, |
| 5 | + quickSearch: 0, |
| 6 | + title: '光社漫画', |
| 7 | + author: 'EylinSir', |
| 8 | + '类型': '漫画', |
| 9 | + logo: 'https://m.g-mh.org/favicon.ico', |
| 10 | + lang: 'ds' |
| 11 | +}) |
| 12 | +*/ |
| 13 | + |
| 14 | +var rule = { |
| 15 | + 类型: '漫画', |
| 16 | + author: 'EylinSir', |
| 17 | + title: '光社漫画', |
| 18 | + host: 'https://m.g-mh.org', |
| 19 | + url: '/manga-genre/fyclass/page/fypage', |
| 20 | + searchUrl: '/s/**?page=fypage', |
| 21 | + logo: 'https://m.g-mh.org/favicon.ico', |
| 22 | + searchable: 2, |
| 23 | + quickSearch: 0, |
| 24 | + timeout: 5000, |
| 25 | + play_parse: true, |
| 26 | + class_name: '热门&国漫&韩漫&日漫&欧美&其他', |
| 27 | + class_url: 'hots&cn&kr&jp&ou-mei&qita', |
| 28 | + headers: { |
| 29 | + 'User-Agent': 'PC_UA', |
| 30 | + 'Referer': 'https://m.g-mh.org/' |
| 31 | + }, |
| 32 | + |
| 33 | + _parse: function(html) { |
| 34 | + return (html.match(/<a href=["']\/manga\/[^"']+["'][\s\S]+?<h3[\s\S]+?<\/h3>/g) || []).map(it => { |
| 35 | + let img = it.match(/src=["']([^"']+)["']/)[1]; |
| 36 | + let descMatch = it.match(/<p class=["']slicardtitlep["'][\s\S]*?>([\s\S]*?)<\/p>/); |
| 37 | + let originalImgUrl = img.startsWith('http') ? img : this.host + img; |
| 38 | + let jpgImgUrl = 'https://wsrv.nl/?url=' + encodeURIComponent(originalImgUrl) + '&output=jpg'; |
| 39 | + return { |
| 40 | + title: it.match(/<h3[^>]*>([\s\S]*?)<\/h3>/)[1].trim(), |
| 41 | + img: jpgImgUrl, |
| 42 | + url: it.match(/href=["']([^"']+)["']/)[1], |
| 43 | + desc: descMatch ? descMatch[1].trim() : '' |
| 44 | + }; |
| 45 | + }); |
| 46 | + }, |
| 47 | + |
| 48 | + 一级: async function(tid, pg, filter, extend) { |
| 49 | + return setResult(this._parse(await request(this.input, { headers: this.headers }))); |
| 50 | + }, |
| 51 | + |
| 52 | + 推荐: async function(tid, pg, filter, extend) { |
| 53 | + return setResult(this._parse(await request(this.input, { headers: this.headers }))); |
| 54 | + }, |
| 55 | + |
| 56 | + 二级: async function(ids) { |
| 57 | + let html = await request(this.input, { headers: this.headers }); |
| 58 | + let mid = (html.match(/data-mid=["'](\d+)["']/) || html.match(/mid\s*:\s*["']?(\d+)["']?/))[1]; |
| 59 | + let json = JSON.parse(await request(`https://api-get-v3.mgsearcher.com/api/manga/get?mid=${mid}&mode=all`, { headers: this.headers })); |
| 60 | + let chapters = json.data.chapters || json.data.data.chapters; |
| 61 | + return { |
| 62 | + vod_id: ids[0], |
| 63 | + vod_name: pdfh(html, 'h1&&Text'), |
| 64 | + vod_pic: pdfh(html, '.rounded-lg img&&src'), |
| 65 | + vod_content: pdfh(html, '.text-medium&&Text'), |
| 66 | + type_name: "漫画", |
| 67 | + vod_play_from: "光社漫画", |
| 68 | + vod_play_url: chapters.map(ch => { |
| 69 | + return `${ch.attributes?.title || 'Chapter ' + ch.id}$https://api-get-v3.mgsearcher.com/api/chapter/getinfo?m=${mid}&c=${ch.id}`; |
| 70 | + }).join("#") |
| 71 | + }; |
| 72 | + }, |
| 73 | + |
| 74 | + 搜索: async function(wd, quick, pg) { |
| 75 | + return setResult(this._parse(await request(this.input, { headers: this.headers }))); |
| 76 | + }, |
| 77 | + |
| 78 | + lazy: async function(flag, id, flags) { |
| 79 | + let data = JSON.parse(await request(id, { headers: this.headers })); |
| 80 | + let images = data.data.info.images.images.map(img => |
| 81 | + img.url.startsWith('http') ? img.url : "https://f40-1-4.g-mh.online" + img.url |
| 82 | + ); |
| 83 | + return { |
| 84 | + parse: 0, |
| 85 | + url: "pics://" + images.join("&&"), |
| 86 | + header: this.headers |
| 87 | + }; |
| 88 | + } |
| 89 | +}; |
0 commit comments