mirror of
https://github.com/iptv-org/epg
synced 2026-05-06 17:37:06 -04:00
linting fixes all files
This commit is contained in:
@@ -7,12 +7,12 @@ dayjs.extend(utc)
|
|||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||||
"accept-language": "en",
|
'accept-language': 'en',
|
||||||
"sec-fetch-site": "same-origin",
|
'sec-fetch-site': 'same-origin',
|
||||||
"sec-fetch-user": "?1",
|
'sec-fetch-user': '?1',
|
||||||
"upgrade-insecure-requests": "1",
|
'upgrade-insecure-requests': '1',
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module.exports = {
|
|||||||
site: 'tataplay.com',
|
site: 'tataplay.com',
|
||||||
days: 1,
|
days: 1,
|
||||||
|
|
||||||
url({ channel, date }) {
|
url({ date }) {
|
||||||
return `https://tm.tapi.videoready.tv/content-detail/pub/api/v2/channels/schedule?date=${date.format('DD-MM-YYYY')}`
|
return `https://tm.tapi.videoready.tv/content-detail/pub/api/v2/channels/schedule?date=${date.format('DD-MM-YYYY')}`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ module.exports = {
|
|||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const prev = programs[programs.length - 1]
|
const prev = programs[programs.length - 1]
|
||||||
const $item = cheerio.load(item)
|
const $item = cheerio.load(item)
|
||||||
const episodeInfo = parseEP($item);
|
const episodeInfo = parseEP($item)
|
||||||
let start = parseStart($item, date)
|
let start = parseStart($item, date)
|
||||||
if (!start) return
|
if (!start) return
|
||||||
if (prev) {
|
if (prev) {
|
||||||
@@ -68,15 +68,15 @@ function parseTitle($item) {
|
|||||||
return $item('h3').text().trim()
|
return $item('h3').text().trim()
|
||||||
}
|
}
|
||||||
function parseEP($item){
|
function parseEP($item){
|
||||||
const text = $item('h6').text().trim();
|
const text = $item('h6').text().trim()
|
||||||
const match = text.match(/Season\s+(\d+)\s*•\s*Episode\s+(\d+)/i);
|
const match = text.match(/Season\s+(\d+)\s*•\s*Episode\s+(\d+)/i)
|
||||||
|
|
||||||
if (!match) return {}; // Return an empty object if no match, so properties are undefined later
|
if (!match) return {} // Return an empty object if no match, so properties are undefined later
|
||||||
|
|
||||||
const season = parseInt(match[1], 10);
|
const season = parseInt(match[1], 10)
|
||||||
const episode = parseInt(match[2], 10);
|
const episode = parseInt(match[2], 10)
|
||||||
|
|
||||||
return { season, episode }; // Return an object with season and episode
|
return { season, episode } // Return an object with season and episode
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseSubtitle($item) {
|
function parseSubtitle($item) {
|
||||||
@@ -84,13 +84,13 @@ function parseSubtitle($item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parsePreviously($item){
|
function parsePreviously($item){
|
||||||
const h3Text = $item('h3').text().trim();
|
const h3Text = $item('h3').text().trim()
|
||||||
const isNewShow = /New$/.test(h3Text);
|
const isNewShow = /New$/.test(h3Text)
|
||||||
|
|
||||||
if (isNewShow) {
|
if (isNewShow) {
|
||||||
return null;
|
return null
|
||||||
} else {
|
} else {
|
||||||
return {};
|
return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user