LF to CRLF

This commit is contained in:
freearhey
2025-09-28 13:06:13 +03:00
parent 5b93a92136
commit ab42da3b0b
17 changed files with 5084 additions and 5056 deletions

View File

@@ -10,7 +10,8 @@ module.exports = {
},
request: {
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'
}
},
parser({ content, date }) {
@@ -39,7 +40,12 @@ module.exports = {
},
async channels() {
const html = await axios
.get('https://www.awilime.com/tv/napi_musor', { headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36' } })
.get('https://www.awilime.com/tv/napi_musor', {
headers: {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36'
}
})
.then(r => r.data)
.catch(console.log)
const $ = cheerio.load(html)

View File

@@ -73,7 +73,8 @@ module.exports = {
let channels = []
const cookies = await axios.get('https://www.directv.com.ar/guia/guia.aspx', {
headers: {
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
@@ -87,56 +88,62 @@ module.exports = {
'Sec-Fetch-User': '?1',
'Sec-GPC': 1,
'Upgrade-Insecure-Requests': 1,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"'
}})
const cookieHeader = cookies.headers['set-cookie'].map(cookie => cookie.split(';')[0]).join('; ')
}
})
const cookieHeader = cookies.headers['set-cookie']
.map(cookie => cookie.split(';')[0])
.join('; ')
const date = dayjs().tz('America/Argentina/Buenos_Aires')
const response = await axios.post(
'https://www.directv.com.ar/guia/guia.aspx/GetProgramming',
{
filterParam: {
day: date.date(),
time: date.hour(),
minute: 0,
month: date.month() + 1,
year: date.year(),
offSetValue: 0,
homeScreenFilter: '',
filtersScreenFilters: [''],
isHd: ''
const response = await axios
.post(
'https://www.directv.com.ar/guia/guia.aspx/GetProgramming',
{
filterParam: {
day: date.date(),
time: date.hour(),
minute: 0,
month: date.month() + 1,
year: date.year(),
offSetValue: 0,
homeScreenFilter: '',
filtersScreenFilters: [''],
isHd: ''
}
},
{
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json; charset=UTF-8',
Cookie: cookieHeader,
Host: 'www.directv.com.ar',
Origin: 'https://www.directv.com.ar',
Pragma: 'no-cache',
Referer: 'https://www.directv.com.ar/guia/guia.aspx',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'Sec-GPC': 1,
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
uzlc: true
}
}
},
{
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json; charset=UTF-8',
Cookie: cookieHeader,
Host: 'www.directv.com.ar',
Origin: 'https://www.directv.com.ar',
Pragma: 'no-cache',
Referer: 'https://www.directv.com.ar/guia/guia.aspx',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'Sec-GPC': 1,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'uzlc': true,
}
}
)
)
.then(r => r.data)
.catch(console.log)

View File

@@ -58,7 +58,8 @@ module.exports = {
let channels = []
const cookies = await axios.get('https://www.directv.com.uy/guia/guia.aspx', {
headers: {
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
@@ -72,56 +73,62 @@ module.exports = {
'Sec-Fetch-User': '?1',
'Sec-GPC': 1,
'Upgrade-Insecure-Requests': 1,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"'
}})
const cookieHeader = cookies.headers['set-cookie'].map(cookie => cookie.split(';')[0]).join('; ')
}
})
const cookieHeader = cookies.headers['set-cookie']
.map(cookie => cookie.split(';')[0])
.join('; ')
const date = dayjs().tz('America/Montevideo')
const response = await axios.post(
'https://www.directv.com.uy/guia/guia.aspx/GetProgramming',
{
filterParam: {
day: date.date(),
time: date.hour(),
minute: 0,
month: date.month() + 1,
year: date.year(),
offSetValue: 0,
homeScreenFilter: '',
filtersScreenFilters: [''],
isHd: ''
const response = await axios
.post(
'https://www.directv.com.uy/guia/guia.aspx/GetProgramming',
{
filterParam: {
day: date.date(),
time: date.hour(),
minute: 0,
month: date.month() + 1,
year: date.year(),
offSetValue: 0,
homeScreenFilter: '',
filtersScreenFilters: [''],
isHd: ''
}
},
{
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json; charset=UTF-8',
Cookie: cookieHeader,
Host: 'www.directv.com.ar',
Origin: 'https://www.directv.com.uy',
Pragma: 'no-cache',
Referer: 'https://www.directv.com.uy/guia/guia.aspx',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'Sec-GPC': 1,
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
uzlc: true
}
}
},
{
headers: {
Accept: '*/*',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Accept-Language': 'es-419,es;q=0.9',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json; charset=UTF-8',
Cookie: cookieHeader,
Host: 'www.directv.com.ar',
Origin: 'https://www.directv.com.uy',
Pragma: 'no-cache',
Referer: 'https://www.directv.com.uy/guia/guia.aspx',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'Sec-GPC': 1,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'uzlc': true,
}
}
)
)
.then(r => r.data)
.catch(console.log)

View File

@@ -151,7 +151,8 @@ async function fetchToken() {
'sec-fetch-site': 'same-origin',
'x-requested-with': 'XMLHttpRequest',
Referer: 'https://www.dishtv.in/channel-guide.html',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
}
})
.then(r => r.data)

View File

@@ -22,7 +22,8 @@ axios.post.mockImplementation((url, data, params) => {
'sec-fetch-site': 'same-origin',
'x-requested-with': 'XMLHttpRequest',
Referer: 'https://www.dishtv.in/channel-guide.html',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
}
})
) {

View File

@@ -11,7 +11,8 @@ dayjs.extend(utc)
const headers = {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0' }
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/115.0.0.0'
}
module.exports = {
site: 'elcinema.com',

View File

@@ -27,7 +27,10 @@ module.exports = {
const data = await axios
.get('https://epg.112114.xyz/pp.xml')
.then(r => r.data)
.catch(e => { console.log(e); return null })
.catch(e => {
console.log(e)
return null
})
if (!data) return []
const { channels = [] } = parser.parse(data)

View File

@@ -18,20 +18,22 @@ module.exports = {
)}&toTime=${date
.add(1, 'days')
.subtract(1, 's')
.format('YYYY-MM-DDTHH:mm:ss-00:00')}&communityId=${communityId}&languageId=${languageId}&cid=${channel.site_id}`
.format(
'YYYY-MM-DDTHH:mm:ss-00:00'
)}&communityId=${communityId}&languageId=${languageId}&cid=${channel.site_id}`
},
request: {
async headers({ country } = {}) {
if (!session) {
session = await loadSessionDetails()
if (!session || !session.access_token) return null
session = await loadSessionDetails()
if (!session || !session.access_token) return null
}
const referer = country === 'me' ? 'https://epg.telemach.me/' : 'https://epg.telemach.ba/'
return {
Authorization: `Bearer ${session.access_token}`,
Referer: referer
Authorization: `Bearer ${session.access_token}`,
Referer: referer
}
}
},
@@ -94,7 +96,8 @@ module.exports = {
.sort((a, b) => {
const ai = Number(a.site_id)
const bi = Number(b.site_id)
if (!Number.isFinite(ai) || !Number.isFinite(bi)) return String(a.site_id).localeCompare(String(b.site_id))
if (!Number.isFinite(ai) || !Number.isFinite(bi))
return String(a.site_id).localeCompare(String(b.site_id))
return ai - bi
})
}
@@ -108,16 +111,15 @@ function parseImage(item) {
async function loadSessionDetails() {
try {
const r = await axios
.post(
'https://api-web.ug-be.cdn.united.cloud/oauth/token?grant_type=client_credentials',
{},
{
headers: {
Authorization: `Basic ${BASIC_TOKEN}`
}
const r = await axios.post(
'https://api-web.ug-be.cdn.united.cloud/oauth/token?grant_type=client_credentials',
{},
{
headers: {
Authorization: `Basic ${BASIC_TOKEN}`
}
)
}
)
return r.data
} catch (message) {
return console.log(message)

View File

@@ -36,7 +36,7 @@ const channel = {
}
it('can generate valid url', async () => {
const result = url({ date, channel, country : 'ba' })
const result = url({ date, channel, country: 'ba' })
expect(result).toBe(
'https://api-web.ug-be.cdn.united.cloud/v1/public/events/epg?fromTime=2025-01-20T00:00:00-00:00&toTime=2025-01-20T23:59:59-00:00&communityId=12&languageId=59&cid=1607'

View File

@@ -56,7 +56,8 @@ module.exports = {
curTag = 'displayName'
curText = ''
// capture possible lang attribute (xml:lang or lang)
current._lang = node.attributes['xml:lang'] || node.attributes['xml:Lang'] || node.attributes.lang
current._lang =
node.attributes['xml:lang'] || node.attributes['xml:Lang'] || node.attributes.lang
}
})
@@ -85,15 +86,14 @@ module.exports = {
})
await new Promise((resolve, reject) => {
res.data
.pipe(zlib.createGunzip())
.pipe(parserStream)
.on('end', resolve)
.on('error', reject)
res.data.pipe(zlib.createGunzip()).pipe(parserStream).on('end', resolve).on('error', reject)
})
return channels.map(channel => {
const displayName = (channel.displayName && channel.displayName[0]) || { lang: 'en', value: channel.id }
const displayName = (channel.displayName && channel.displayName[0]) || {
lang: 'en',
value: channel.id
}
return {
lang: displayName.lang || 'en',
site_id: `${tag}#${channel.id}`,