mirror of
https://github.com/iptv-org/epg
synced 2026-05-09 19:07:03 -04:00
Fix linter issues in sites/
This commit is contained in:
@@ -9,15 +9,9 @@ module.exports = {
|
||||
url({ date, channel }) {
|
||||
return `https://waf-starhub-metadata-api-p001.ifs.vubiquity.com/v3.1/epg/schedules?locale=${
|
||||
languages[channel.lang]
|
||||
}&locale_default=${
|
||||
languages[channel.lang]
|
||||
}&device=1&in_channel_id=${
|
||||
}&locale_default=${languages[channel.lang]}&device=1&in_channel_id=${
|
||||
channel.site_id
|
||||
}>_end=${
|
||||
date.unix()
|
||||
}<_start=${
|
||||
date.add(1, 'd').unix()
|
||||
}&limit=100&page=1`
|
||||
}>_end=${date.unix()}<_start=${date.add(1, 'd').unix()}&limit=100&page=1`
|
||||
},
|
||||
async parser({ content, date, channel }) {
|
||||
const programs = []
|
||||
@@ -29,7 +23,11 @@ module.exports = {
|
||||
}
|
||||
if (res.page && res.page.current < res.page.total) {
|
||||
res = await axios
|
||||
.get(module.exports.url({ date, channel }).replace(/page=(\d+)/, `page=${res.page.current + 1}`))
|
||||
.get(
|
||||
module.exports
|
||||
.url({ date, channel })
|
||||
.replace(/page=(\d+)/, `page=${res.page.current + 1}`)
|
||||
)
|
||||
.then(r => r.data)
|
||||
.catch(console.error)
|
||||
} else {
|
||||
@@ -39,7 +37,7 @@ module.exports = {
|
||||
}
|
||||
const season = s => {
|
||||
if (s) {
|
||||
const [ , , n ] = s.match(/(S|Season )(\d+)/) || [null, null, null]
|
||||
const [, , n] = s.match(/(S|Season )(\d+)/) || [null, null, null]
|
||||
if (n) {
|
||||
return parseInt(n)
|
||||
}
|
||||
@@ -66,11 +64,9 @@ module.exports = {
|
||||
let page = 1
|
||||
while (true) {
|
||||
const items = await axios
|
||||
.get(`https://waf-starhub-metadata-api-p001.ifs.vubiquity.com/v3.1/epg/channels?locale=${
|
||||
languages[lang]
|
||||
}&locale_default=${
|
||||
languages[lang]
|
||||
}&device=1&limit=50&page=${page}`)
|
||||
.get(
|
||||
`https://waf-starhub-metadata-api-p001.ifs.vubiquity.com/v3.1/epg/channels?locale=${languages[lang]}&locale_default=${languages[lang]}&device=1&limit=50&page=${page}`
|
||||
)
|
||||
.then(r => r.data)
|
||||
.catch(console.error)
|
||||
if (items.resources) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { parser, url, request } = require('./starhubtvplus.com.config.js')
|
||||
const { parser, url } = require('./starhubtvplus.com.config.js')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
@@ -36,9 +36,12 @@ it('can parse response', async () => {
|
||||
title: 'Northern Rexposure',
|
||||
subTitle: 'Hudson & Rex (Season 5)',
|
||||
description:
|
||||
'When Jesse\'s sister contacts him for help, he, Sarah and Rex head to Northern Ontario and find themselves in the middle of a deadly situation.',
|
||||
"When Jesse's sister contacts him for help, he, Sarah and Rex head to Northern Ontario and find themselves in the middle of a deadly situation.",
|
||||
category: ['Drama'],
|
||||
image: ['https://poster.starhubgo.com/poster/ch511_hudson_rex5.jpg?w=960&h=540', 'https://poster.starhubgo.com/poster/ch511_hudson_rex5.jpg?w=341&h=192'],
|
||||
image: [
|
||||
'https://poster.starhubgo.com/poster/ch511_hudson_rex5.jpg?w=960&h=540',
|
||||
'https://poster.starhubgo.com/poster/ch511_hudson_rex5.jpg?w=341&h=192'
|
||||
],
|
||||
season: 5,
|
||||
episode: 15,
|
||||
rating: 'PG13'
|
||||
|
||||
Reference in New Issue
Block a user