Skip to content

Commit

Permalink
Update dev.0n0.miru.7xi.js
Browse files Browse the repository at this point in the history
  • Loading branch information
appdevelpo committed Nov 15, 2023
1 parent 58159cb commit 07aec6c
Showing 1 changed file with 36 additions and 48 deletions.
84 changes: 36 additions & 48 deletions repo/dev.0n0.miru.7xi.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
// ==MiruExtension==
// @name 7喜影院
// @version v0.0.5
// @version v0.0.6
// @author MiaoMint
// @lang zh-cn
// @license MIT
// @icon https://www.7xi.tv/upload/site/20220630-1/f0aa6861d2399c58f87faab0f1928b10.png
// @package dev.0n0.miru.7xi
// @type bangumi
// @webSite https://www.7xi.tv/
// @webSite https://www.7xi.tv
// ==/MiruExtension==

export default class extends Extension {
constructor() {
super("https://www.7xi.tv/")
}
getCover(url) {
if (url.indexOf("http") == -1) {
return `https://www.7xi.tv${url}`
Expand All @@ -23,43 +20,39 @@ export default class extends Extension {

async search(kw, page) {
const res = await this.request(`/vodsearch/page/${page}/wd/${kw}.html`)
const ul = res.match(/<ul class="hl-one-list([\s\S]+?)<\/ul/)[1]
const li = ul.match(/<li([\s\S]+?)<\/li>/g)

const li = res.match(/public-list-box search-box flex rel[^']+?<\/div><\/div><\/div>/g)
const bangumi = []
li.forEach(e => {
const title = e.match(/title="(.+?)"/)[1]
// console.log(e)
const title = e.match(/html">([^"]+?)<\/a>/)[1]
const url = e.match(/href="(.+?)"/)[1]
const cover = this.getCover(e.match(/data-original="(.+?)"/)[1])
const update = e.match(/<span class="hl-lc-1 remarks">(.+?)<\/span>/)[1]
const cover = e.match(/data-src="(.+?)"/)[1]
const cover_url = cover.includes("https")?cover:`https://www.7xi.tv${cover}`;
const update = e.match(/"public-list-prb hide ft2">(.+?)<\/span>/)[1];
bangumi.push({
title,
url,
cover,
update,
cover:cover_url,
update
})
})
return bangumi
}
async latest() {
const res = await this.request("/label/rankweek.html")
const ul = /class="hl-rank-list clearfix"([\s\S]+?)\/ul/g.exec(res)[0]
const li = ul.match(/<li class="hl-list-item hl-col-xs-12">([\s\S]+?)<\/li>/g)
const res = await this.request("/map.html")
const li = res.match(/public-list-box public-pic-b [^']+?<\/div><\/div><\/div>/g)
const bangumi = []
li.forEach(e => {
const title = e.match(/title="(.+?)"/)[1]
const url = e.match(/href="(.+?)"/)[1]
const cover = this.getCover(e.match(/data-original="(.+?)"/)[1])
let update = ""
try {
update = e.match(/<span class="hl-text-conch score">(.+?)<\/span>(.+?)<\/div>/)[2]
} catch (error) {
update = ""
console.log(error);
}
const cover = e.match(/data-src="(.+?)"/)[1]
const cover_url = cover.includes("https")?cover:`https://www.7xi.tv${cover}`;
const update = e.match(/"public-list-prb hide ft2">(.+?)<\/span>/)[1];
bangumi.push({
title,
url,
cover,
cover:cover_url,
update
})
})
Expand All @@ -68,28 +61,27 @@ export default class extends Extension {

async detail(url) {
const res = await this.request(url)
const desc = res.match(/name="description" content="(.+?)"/)[1]
const cover = this.getCover(res.match(/data-original="(.+?)"/)[1])
const title = res.match(/hl-dc-title hl-data-menu">(.+?)</)[1]
const watchUrlTitleStr = res.match(/hl-plays-from hl-tabs swiper-wrapper clearfix">([\s\S]+?)<\/div>/g)[0]
const watchUrlTitle = watchUrlTitleStr.match(/alt="(.+?)"/g)
const watchUrlGroupsStr = res.match(/id="hl-plays-list">([\s\S]+?)<\/ul/g)
const episodes = []
let i = 0
watchUrlGroupsStr.forEach(e => {
const episode = []
let lis = e.match(/<li([\s\S]+?)<\/li>/g)
lis.forEach(e => {
const match = e.match(/<a href="(.+?)">(.+?)<\/a>/)
episode.push({
url: match[1],
name: match[2],
})
// console.log(res)
const desc = res.match(/id="height_limit".+?>(.+?)<\/div>/)[1]
const cover = this.getCover(res.match(/img alt=".+?" class="lazy lazy1 mask-1"[^']+?data-src="(.+?)"/)[1])
const title = res.match(/<h3.+?>(.+?)<\/h3>/)[1]
const ep_server = res.match(/<ul class="anthology-list-play size"[^']+?<\/ul>/g)
const server_name = res.match(/<i class="fa ds-dianying"><\/i>.+?<\/a>/g).map((e)=>{
return e.match(/&nbsp;(.+?)</)[1]
})
console.log(server_name)
const episodes = [];
ep_server.forEach((element,index)=>{
const llist = element.match(/<li[^']+?<\/li>/g)
const ep_element = llist.map((e)=>{
return {
name:e.match(/html">(.+?)</)[1],
url:e.match(/href="(.+?)"/)[1]
}
})
const title = watchUrlTitle[i++].split(`"`)[1]
episodes.push({
title: title,
urls: episode
title:server_name[index],
urls:ep_element
})
})
return {
Expand All @@ -109,9 +101,5 @@ export default class extends Extension {
}
}

async checkUpdate(url) {
const res = await this.request(url)
return res.match(/<span class="hl-text-conch">(.+?)<\/span>/)[1]
}

}

0 comments on commit 07aec6c

Please sign in to comment.