mirror of
https://github.com/iptv-org/epg
synced 2026-09-16 14:06:24 -04:00
@@ -10,22 +10,17 @@ dayjs.extend(customParseFormat)
|
||||
module.exports = {
|
||||
site: 'dens.tv',
|
||||
days: 2,
|
||||
url: function ({ channel, date }) {
|
||||
url({ channel, date }) {
|
||||
return `https://www.dens.tv/tvpage_octo/epgchannel2/${date.format('YYYY-MM-DD')}/${
|
||||
channel.site_id
|
||||
}`
|
||||
},
|
||||
parser: function ({ content }) {
|
||||
parser({ content }) {
|
||||
// parsing
|
||||
const response = JSON.parse(content)
|
||||
const programs = []
|
||||
|
||||
if (
|
||||
response.response !== undefined &&
|
||||
response.response === 0 &&
|
||||
response.data !== undefined &&
|
||||
Array.isArray(response.data)
|
||||
) {
|
||||
if (Array.isArray(response?.data)) {
|
||||
response.data.forEach(item => {
|
||||
programs.push({
|
||||
title: item.title,
|
||||
@@ -46,14 +41,14 @@ module.exports = {
|
||||
international: 3
|
||||
}
|
||||
|
||||
let channels = []
|
||||
const channels = []
|
||||
for (const id_category of Object.values(categories)) {
|
||||
const data = await axios
|
||||
.get(`https://www.dens.tv/api/dens3/tv/TvChannels/listByCategory`, {
|
||||
params: { id_category }
|
||||
})
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
.catch(console.error)
|
||||
|
||||
data.data.contents.forEach(item => {
|
||||
channels.push({
|
||||
|
||||
Reference in New Issue
Block a user