finish lo-ditching and update deps

This commit is contained in:
theofficialomega
2025-07-19 22:38:50 +02:00
parent 5e953b6955
commit 4acf1a7c67
9 changed files with 2806 additions and 10207 deletions

View File

@@ -1,4 +1,3 @@
const _ = require('lodash')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
@@ -62,5 +61,5 @@ function parseItems(content) {
if (!content) return []
const data = JSON.parse(content)
return _.flatten(Object.values(data.result))
return Object.values(data.result).flat()
}

View File

@@ -3,7 +3,7 @@ const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const doFetch = require('@ntlab/sfetch')
const debug = require('debug')('site:sky.com')
const _ = require('lodash')
const { sortBy } = require('../../scripts/functions')
dayjs.extend(utc)
@@ -26,7 +26,7 @@ module.exports = {
.filter(schedule => schedule.sid === channel.site_id)
.forEach(schedule => {
if (Array.isArray(schedule.events)) {
_.sortBy(schedule.events, 'st').forEach(event => {
sortBy(schedule.events, p => p.st).forEach(event => {
const start = dayjs.utc(event.st * 1000)
if (start.isSame(date, 'd')) {
const image = `https://images.metadata.sky.com/pd-image/${event.programmeuuid}/16-9/640`

View File

@@ -3,6 +3,7 @@ const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const uniqBy = require('../../scripts/functions')
dayjs.extend(utc)
dayjs.extend(timezone)
@@ -42,7 +43,6 @@ module.exports = {
},
async channels() {
const axios = require('axios')
const _ = require('lodash')
const providers = ['-1', '-2', '-3', '-4', '-5']
@@ -77,7 +77,7 @@ module.exports = {
})
}
return _.uniqBy(channels, 'site_id')
return uniqBy(channels, x => x.site_id)
}
}

View File

@@ -1,6 +1,7 @@
const cheerio = require('cheerio')
const axios = require('axios')
const { DateTime } = require('luxon')
const { uniqBy } = require('../../scripts/functions')
module.exports = {
site: 'tvhebdo.com',
@@ -34,7 +35,6 @@ module.exports = {
return programs
},
async channels() {
const _ = require('lodash')
let items = []
const offsets = [
@@ -72,7 +72,7 @@ module.exports = {
})
})
return _.uniqBy(channels, 'site_id')
return uniqBy(channels, x => x.site_id)
}
}

View File

@@ -3,6 +3,7 @@ const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const { uniqBy } = require('../../scripts/functions')
dayjs.extend(utc)
dayjs.extend(timezone)
@@ -42,7 +43,6 @@ module.exports = {
},
async channels() {
const axios = require('axios')
const _ = require('lodash')
const providers = ['-9000019', '-8000019', '-1000019', '-2000019', '-7000019']
@@ -77,7 +77,7 @@ module.exports = {
})
}
return _.uniqBy(channels, 'site_id')
return uniqBy(channels, x => x.site_id)
}
}

View File

@@ -1,6 +1,6 @@
const axios = require('axios')
const dayjs = require('dayjs')
const _ = require('lodash')
const { uniqBy } = require('../../scripts/functions')
module.exports = {
site: 'tvmusor.hu',
@@ -77,5 +77,5 @@ function parseItems(content, channel, date) {
const blockId = `${channel.site_id}_${date.format('YYYY-MM-DD')}`
if (!Array.isArray(blocks[blockId])) return []
return _.uniqBy(_.uniqBy(blocks[blockId], 'e'), 'b')
return uniqBy(uniqBy(blocks[blockId], a => a.e), b => b.b)
}

View File

@@ -2,7 +2,6 @@ const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const { upperCase } = require('lodash')
let X_CSRFTOKEN
let Cookie
@@ -56,7 +55,7 @@ module.exports = {
directors: parseDirectors(item),
producers: parseProducers(item),
adapters: parseAdapters(item),
country: upperCase(item.country),
country: item.country?.toUpperCase(),
date: item.producedate,
urls: parseUrls(item)
})