mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
[update] add @BellezaEmporium code
This commit is contained in:
parent
f641443a9d
commit
55ab874160
1 changed files with 25 additions and 17 deletions
|
@ -18,14 +18,24 @@ module.exports = {
|
|||
url: function ({ date, channel }) {
|
||||
let [type, ...code] = channel.site_id.split('_')
|
||||
code = code.join('_')
|
||||
console.log(`https://www.skyperfectv.co.jp/program/schedule/${type}/channel:${code}/date:${date.format('YYMMDD')}`)
|
||||
return `https://www.skyperfectv.co.jp/program/schedule/${type}/channel:${code}/date:${date.format('YYMMDD')}`
|
||||
},
|
||||
logo: function ({channel}) {
|
||||
logo: function ({ channel }) {
|
||||
return `https://www.skyperfectv.co.jp/library/common/img/channel/icon/basic/m_${channel.site_id.toLowerCase()}.gif`
|
||||
},
|
||||
parser: function ({ content, date }) {
|
||||
const $ = cheerio.load(content)
|
||||
// Specific function that permits to gather NSFW channels (needs confirmation)
|
||||
async fetchSchedule({ date, channel }) {
|
||||
const url = this.url({ date, channel })
|
||||
const response = await axios.get(url, {
|
||||
headers: {
|
||||
'Cookie': 'adult_auth=true'
|
||||
}
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
async parser({ date, channel }) {
|
||||
const sched = await this.fetchSchedule({ date, channel })
|
||||
const $ = cheerio.load(sched)
|
||||
const programs = []
|
||||
|
||||
const sections = [
|
||||
|
@ -53,12 +63,6 @@ module.exports = {
|
|||
const [start, stop] = $itemElement.find('.p-program__range').first().text().split('〜').map(parseTime)
|
||||
const title = $itemElement.find('.p-program__name').first().text()
|
||||
const image = $itemElement.find('.js-program_thumbnail').first().attr('data-lazysrc')
|
||||
console.log({
|
||||
title,
|
||||
start,
|
||||
stop,
|
||||
image
|
||||
})
|
||||
programs.push({
|
||||
title,
|
||||
start,
|
||||
|
@ -89,7 +93,11 @@ module.exports = {
|
|||
}
|
||||
|
||||
const getChannels = async (type) => {
|
||||
const response = await axios.get(`https://www.skyperfectv.co.jp/program/schedule/${type}/`)
|
||||
const response = await axios.get(`https://www.skyperfectv.co.jp/program/schedule/${type}/`, {
|
||||
headers: {
|
||||
'Cookie': 'adult_auth=true;'
|
||||
}
|
||||
})
|
||||
return pageParser(response.data, type)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue