Include dens.tv in SITES.

Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
Toha
2023-11-30 21:36:25 +07:00
parent c4fb606323
commit 37de183dc6
5 changed files with 47 additions and 30 deletions
+5 -10
View File
@@ -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({