Fix linter issues in sites/

This commit is contained in:
freearhey
2025-01-01 12:27:22 +03:00
parent d6d20b6413
commit 5df982bb7c
129 changed files with 3316 additions and 3226 deletions

View File

@@ -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
}&gt_end=${
date.unix()
}&lt_start=${
date.add(1, 'd').unix()
}&limit=100&page=1`
}&gt_end=${date.unix()}&lt_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) {

View File

@@ -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'