Replace LF line endings with CRLF

This commit is contained in:
freearhey
2025-09-28 17:55:05 +03:00
parent efc74efcf8
commit b6a589c62a
1192 changed files with 445631 additions and 445631 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Central" site_id="1722195092">REV'N Central</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Eastern" site_id="380697915">REV'N Eastern</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Mountain" site_id="1014453176">REV'N Mountain</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Pacific" site_id="589261086">REV'N Pacific</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Web" site_id="494637005">REV'N Web Feed</channel>
</channels>
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Central" site_id="1722195092">REV'N Central</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Eastern" site_id="380697915">REV'N Eastern</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Mountain" site_id="1014453176">REV'N Mountain</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Pacific" site_id="589261086">REV'N Pacific</channel>
<channel site="getafteritmedia.com" lang="en" xmltv_id="REVN.us@Web" site_id="494637005">REV'N Web Feed</channel>
</channels>

View File

@@ -1,64 +1,64 @@
const table2array = require('table2array')
const cheerio = require('cheerio')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const isoWeek = require('dayjs/plugin/isoWeek')
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(customParseFormat)
dayjs.extend(isoWeek)
module.exports = {
site: 'getafteritmedia.com',
days: 2,
url: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQcDmb9OnO0HpbjINfGaepqgGTp3VSmPs7hs654n3sRKrq4Q9y6uPSEvVvq9MwTLYG_n_V7vh0rFYP9/pubhtml',
parser({ content, channel, date }) {
const programs = []
const items = parseItems(content, channel, date)
items.forEach(item => {
const prev = programs[programs.length - 1]
let start = parseStart(item, date)
if (prev) {
if (start.isBefore(prev.start)) {
start = start.add(1, 'd')
date = date.add(1, 'd')
}
prev.stop = start
}
const stop = start.add(30, 'm')
programs.push({
title: item.title,
start,
stop
})
})
return programs
}
}
function parseStart(item, date) {
return dayjs.tz(
`${date.format('YYYY-MM-DD')} ${item.time}`,
'YYYY-MM-DD HH:mm A',
'America/New_York'
)
}
function parseItems(content, channel, date) {
const day = date.isoWeekday()
const $ = cheerio.load(content)
const table = $.html($(`#${channel.site_id} table`))
let data = table2array(table)
data.splice(0, 5)
return data.map(row => {
return {
time: row[1],
title: row[day + 1]
}
})
}
const table2array = require('table2array')
const cheerio = require('cheerio')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const isoWeek = require('dayjs/plugin/isoWeek')
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(customParseFormat)
dayjs.extend(isoWeek)
module.exports = {
site: 'getafteritmedia.com',
days: 2,
url: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQcDmb9OnO0HpbjINfGaepqgGTp3VSmPs7hs654n3sRKrq4Q9y6uPSEvVvq9MwTLYG_n_V7vh0rFYP9/pubhtml',
parser({ content, channel, date }) {
const programs = []
const items = parseItems(content, channel, date)
items.forEach(item => {
const prev = programs[programs.length - 1]
let start = parseStart(item, date)
if (prev) {
if (start.isBefore(prev.start)) {
start = start.add(1, 'd')
date = date.add(1, 'd')
}
prev.stop = start
}
const stop = start.add(30, 'm')
programs.push({
title: item.title,
start,
stop
})
})
return programs
}
}
function parseStart(item, date) {
return dayjs.tz(
`${date.format('YYYY-MM-DD')} ${item.time}`,
'YYYY-MM-DD HH:mm A',
'America/New_York'
)
}
function parseItems(content, channel, date) {
const day = date.isoWeekday()
const $ = cheerio.load(content)
const table = $.html($(`#${channel.site_id} table`))
let data = table2array(table)
data.splice(0, 5)
return data.map(row => {
return {
time: row[1],
title: row[day + 1]
}
})
}

View File

@@ -1,45 +1,45 @@
const { parser, url } = require('./getafteritmedia.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-26', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: '494637005',
xmltv_id: 'REVNWebFeed.us'
}
it('can generate valid url', () => {
expect(url).toBe(
'https://docs.google.com/spreadsheets/d/e/2PACX-1vQcDmb9OnO0HpbjINfGaepqgGTp3VSmPs7hs654n3sRKrq4Q9y6uPSEvVvq9MwTLYG_n_V7vh0rFYP9/pubhtml'
)
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
let results = parser({ content, channel, date })
results = results.map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
return p
})
expect(results[0]).toMatchObject({
start: '2022-11-26T05:00:00.000Z',
stop: '2022-11-26T05:30:00.000Z',
title: 'The Appraisers'
})
})
it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '<!DOCTYPE html><html><head></head><body></body></html>'
})
expect(result).toMatchObject([])
})
const { parser, url } = require('./getafteritmedia.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-26', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: '494637005',
xmltv_id: 'REVNWebFeed.us'
}
it('can generate valid url', () => {
expect(url).toBe(
'https://docs.google.com/spreadsheets/d/e/2PACX-1vQcDmb9OnO0HpbjINfGaepqgGTp3VSmPs7hs654n3sRKrq4Q9y6uPSEvVvq9MwTLYG_n_V7vh0rFYP9/pubhtml'
)
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
let results = parser({ content, channel, date })
results = results.map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
return p
})
expect(results[0]).toMatchObject({
start: '2022-11-26T05:00:00.000Z',
stop: '2022-11-26T05:30:00.000Z',
title: 'The Appraisers'
})
})
it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '<!DOCTYPE html><html><head></head><body></body></html>'
})
expect(result).toMatchObject([])
})

View File

@@ -1,15 +1,15 @@
# getafteritmedia.com
https://www.getafteritmedia.com/guia_tv/completa
### Download the guide
```sh
npm run grab --- --site=getafteritmedia.com
```
### Test
```sh
npm test --- getafteritmedia.com
```
# getafteritmedia.com
https://www.getafteritmedia.com/guia_tv/completa
### Download the guide
```sh
npm run grab --- --site=getafteritmedia.com
```
### Test
```sh
npm test --- getafteritmedia.com
```