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="worldfishingnetwork.com">
<channels>
<channel lang="en" xmltv_id="WorldFishingNetwork.us" site_id="#">World Fishing Network</channel>
</channels>
</site>
<channels>
<channel site="worldfishingnetwork.com" lang="en" xmltv_id="WorldFishingNetwork.us" site_id="#">World Fishing Network</channel>
</channels>

View File

@@ -16,7 +16,7 @@ module.exports = {
},
parser({ content, date }) {
const programs = []
const items = parseItems(content, date)
const items = parseItems(content)
items.forEach(item => {
let $item = cheerio.load(item)
const prev = programs[programs.length - 1]
@@ -72,7 +72,7 @@ function parseStart($item, date) {
)
}
function parseItems(content, channel, date) {
function parseItems(content) {
const $ = cheerio.load(content)
return $('.show-item').toArray()

View File

@@ -1,4 +1,4 @@
// npx epg-grabber --config=sites/worldfishingnetwork.com/worldfishingnetwork.com.config.js --channels=sites/worldfishingnetwork.com/worldfishingnetwork.com.channels.xml --output=guide.xml --days=2
// npm run grab -- --site=worldfishingnetwork.com
const { parser, url } = require('./worldfishingnetwork.com.config.js')
const fs = require('fs')
@@ -10,10 +10,6 @@ dayjs.extend(customParseFormat)
dayjs.extend(utc)
const date = dayjs.utc('2023-01-24', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: '#',
xmltv_id: 'WorldFishingNetwork.us'
}
it('can generate valid url', () => {
expect(url({ date })).toBe('https://www.worldfishingnetwork.com/schedule/77420?day=Tue')
@@ -31,7 +27,7 @@ it('can parse response', () => {
expect(results[0]).toMatchObject({
start: '2023-01-24T05:00:00.000Z',
stop: '2023-01-24T07:00:00.000Z',
title: `Major League Fishing`,
title: 'Major League Fishing',
sub_title: 'Challenge Cup Sudden Death Round 2',
description:
'Nine anglers race to a target weight on Lake Wylie in the Lucas Oil Challenge Cup, presented by B&W Trailer Hitches, Rock Hill, South Carolina. Only four will move on to the Championship Round.',
@@ -41,7 +37,7 @@ it('can parse response', () => {
expect(results[41]).toMatchObject({
start: '2023-01-25T04:30:00.000Z',
stop: '2023-01-25T05:00:00.000Z',
title: `Fishing 411`,
title: 'Fishing 411',
sub_title: 'Flint Wilderness Walleye',
description:
'Mark Romanack and Bryan Darland fish walleye on Klotz Lake in the famed Flint Wilderness of Ontario',