[fix] fixing skyperfectv.co.jp

This commit is contained in:
Animenosekai 2024-10-13 21:38:15 +02:00
parent 276414bc63
commit aa77d8abe6
3 changed files with 14 additions and 13 deletions

View file

@ -17,9 +17,9 @@ module.exports = {
const id = `SV${channel.site_id}EPG${date.format('YYYYMMDD')}` const id = `SV${channel.site_id}EPG${date.format('YYYYMMDD')}`
return `https://s.mxtv.jp/bangumi_file/json01/${id}.json` return `https://s.mxtv.jp/bangumi_file/json01/${id}.json`
}, },
parser: function ({ content, channel, date }) { parser: function ({ content }) {
let programs = [] let programs = []
const items = parseItems(content, channel, date) const items = parseItems(content)
items.forEach(item => { items.forEach(item => {
programs.push({ programs.push({
title: item.Event_name, title: item.Event_name,
@ -32,7 +32,7 @@ module.exports = {
}) })
return programs return programs
}, },
async channels() { channels() {
return [ return [
{ {
lang: 'ja', lang: 'ja',

View file

@ -11,7 +11,7 @@ dayjs.extend(timezone)
dayjs.extend(customParseFormat) dayjs.extend(customParseFormat)
dayjs.extend(duration) dayjs.extend(duration)
module.exports = { const exported = {
site: 'skyperfectv.co.jp', site: 'skyperfectv.co.jp',
days: 1, days: 1,
lang: 'ja', lang: 'ja',
@ -25,7 +25,7 @@ module.exports = {
}, },
// Specific function that permits to gather NSFW channels (needs confirmation) // Specific function that permits to gather NSFW channels (needs confirmation)
async fetchSchedule({ date, channel }) { async fetchSchedule({ date, channel }) {
const url = this.url({ date, channel }) const url = exported.url({ date, channel })
const response = await axios.get(url, { const response = await axios.get(url, {
headers: { headers: {
'Cookie': 'adult_auth=true' 'Cookie': 'adult_auth=true'
@ -33,9 +33,8 @@ module.exports = {
}) })
return response.data return response.data
}, },
async parser({ date, channel }) { parser({ content, date }) {
const sched = await this.fetchSchedule({ date, channel }) const $ = cheerio.load(content)
const $ = cheerio.load(sched)
const programs = [] const programs = []
const sections = [ const sections = [
@ -111,3 +110,5 @@ module.exports = {
return await fetchAllChannels() return await fetchAllChannels()
} }
} }
module.exports = exported

File diff suppressed because one or more lines are too long