Update /sites

This commit is contained in:
freearhey
2023-10-02 06:35:33 +03:00
parent ca254a6df0
commit c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions

View File

@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="ionplustv.com">
<channels>
<channel lang="en" xmltv_id="IONPlusEast.us" site_id="#">ION Plus</channel>
</channels>
</site>
<channels>
<channel site="ionplustv.com" lang="en" xmltv_id="IONPlusEast.us" site_id="#">ION Plus</channel>
</channels>

View File

@@ -1,4 +1,3 @@
const axios = require('axios')
const dayjs = require('dayjs')
const cheerio = require('cheerio')
const utc = require('dayjs/plugin/utc')
@@ -67,7 +66,7 @@ function parseSubTitle($item) {
}
function parseRating($item) {
const [_, rating] = $item('.tv-rating')
const [, rating] = $item('.tv-rating')
.text()
.match(/([^(]+)/) || [null, null]
@@ -92,7 +91,7 @@ function parseStart($item, date) {
}
function parseDuration($item) {
const [_, duration] = $item('.tv-rating')
const [, duration] = $item('.tv-rating')
.text()
.trim()
.match(/\((\d+)/) || [null, null]
@@ -104,5 +103,5 @@ function parseItems(content) {
if (!content) return []
const $ = cheerio.load(content)
return $(`#accordion > div`).toArray()
return $('#accordion > div').toArray()
}

View File

@@ -1,19 +1,16 @@
// npx epg-grabber --config=sites/ionplustv.com/ionplustv.com.config.js --channels=sites/ionplustv.com/ionplustv.com.channels.xml --output=guide.xml --days=2
// npm run grab -- --site=ionplustv.com
const { parser, url, request } = require('./ionplustv.com.config.js')
const { parser, url } = require('./ionplustv.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-08', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: '#',
xmltv_id: 'IONPlus.us'
}
it('can generate valid url', () => {
expect(url({ date })).toBe('https://ionplustv.com/schedule/2022-11-08')