mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 01:20:08 -04:00
Merge pull request #1434 from iptv-org/add-compulms.com
Add guide from compulms.com
This commit is contained in:
commit
898ea5412c
5 changed files with 1390 additions and 0 deletions
17
.github/workflows/compulms.com.yml
vendored
Normal file
17
.github/workflows/compulms.com.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: compulms.com
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * *'
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
workflows: [_trigger]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
load:
|
||||
uses: ./.github/workflows/_load.yml
|
||||
with:
|
||||
site: ${{github.workflow}}
|
||||
secrets:
|
||||
APP_ID: ${{ secrets.APP_ID }}
|
||||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
|
1293
sites/compulms.com/__data__/content.xml
Normal file
1293
sites/compulms.com/__data__/content.xml
Normal file
File diff suppressed because it is too large
Load diff
32
sites/compulms.com/compulms.com.config.js
Normal file
32
sites/compulms.com/compulms.com.config.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
const parser = require('epg-parser')
|
||||
|
||||
module.exports = {
|
||||
site: 'compulms.com',
|
||||
request: {
|
||||
cache: {
|
||||
ttl: 60 * 60 * 1000 // 1 hour
|
||||
}
|
||||
},
|
||||
url: 'https://raw.githubusercontent.com/luisms123/tdt/master/guiaenergeek.xml',
|
||||
parser: function ({ content, channel, date }) {
|
||||
let programs = []
|
||||
const items = parseItems(content, channel, date)
|
||||
items.forEach(item => {
|
||||
programs.push({
|
||||
title: item.title?.[0].value,
|
||||
description: item.desc?.[0].value,
|
||||
icon: item.icon?.[0],
|
||||
start: item.start,
|
||||
stop: item.stop
|
||||
})
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
function parseItems(content, channel, date) {
|
||||
const { programs } = parser.parse(content)
|
||||
|
||||
return programs.filter(p => p.channel === channel.site_id && date.isSame(p.start, 'day'))
|
||||
}
|
39
sites/compulms.com/compulms.com.test.js
Normal file
39
sites/compulms.com/compulms.com.test.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
// npx epg-grabber --config=sites/compulms.com/compulms.com.config.js --channels=sites/compulms.com/compulms.com_mx.channels.xml --output=guide.xml --days=2
|
||||
|
||||
const { parser, url } = require('./compulms.com.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2022-11-29', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: 'EnerGeek Retro',
|
||||
xmltv_id: 'EnerGeekRetro.cl'
|
||||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url).toBe('https://raw.githubusercontent.com/luisms123/tdt/master/guiaenergeek.xml')
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.xml'))
|
||||
let results = parser({ content, channel, date })
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2022-11-29T03:00:00.000Z',
|
||||
stop: '2022-11-29T03:30:00.000Z',
|
||||
title: 'Noir',
|
||||
description:
|
||||
'Kirika Yuumura es una adolescente japonesa que no recuerda nada de su pasado, salvo la palabra NOIR, por lo que decidirá contactar con Mireille Bouquet, una asesina profesional para que la ayude a investigar. Ambas forman un equipo muy eficiente, que resuelve un trabajo tras otro con gran éxito, hasta que aparece un grupo conocido como "Les Soldats", relacionados con el pasado de Kirika. Estos tratarán de eliminar a las dos chicas, antes de que indaguen más hondo sobre la verdad acerca de Noir',
|
||||
icon: 'https://pics.filmaffinity.com/nowaru_noir_tv_series-225888552-mmed.jpg'
|
||||
})
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const result = parser({ content: '', channel, date })
|
||||
expect(result).toMatchObject([])
|
||||
})
|
9
sites/compulms.com/compulms.com_mx.channels.xml
Normal file
9
sites/compulms.com/compulms.com_mx.channels.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="compulms.com">
|
||||
<channels>
|
||||
<channel lang="es" xmltv_id="EnerGeekAnimate.cl" site_id="EnerGeek Animate">EnerGeek Animate</channel>
|
||||
<channel lang="es" xmltv_id="EnerGeekFanpop.cl" site_id="EnerGeek Fanpop">EnerGeek Fanpop</channel>
|
||||
<channel lang="es" xmltv_id="EnerGeekRadio.cl" site_id="EnerGeek Radio TV">EnerGeek Radio TV</channel>
|
||||
<channel lang="es" xmltv_id="EnerGeekRetro.cl" site_id="EnerGeek Retro">EnerGeek Retro</channel>
|
||||
</channels>
|
||||
</site>
|
Loading…
Add table
Add a link
Reference in a new issue