mirror of
https://github.com/iptv-org/epg
synced 2025-12-19 11:56:58 -05:00
LF to CRLF
This commit is contained in:
@@ -10,7 +10,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
request: {
|
request: {
|
||||||
headers: {
|
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 }) {
|
parser({ content, date }) {
|
||||||
@@ -39,7 +40,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
async channels() {
|
async channels() {
|
||||||
const html = await axios
|
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)
|
.then(r => r.data)
|
||||||
.catch(console.log)
|
.catch(console.log)
|
||||||
const $ = cheerio.load(html)
|
const $ = cheerio.load(html)
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ module.exports = {
|
|||||||
let channels = []
|
let channels = []
|
||||||
const cookies = await axios.get('https://www.directv.com.ar/guia/guia.aspx', {
|
const cookies = await axios.get('https://www.directv.com.ar/guia/guia.aspx', {
|
||||||
headers: {
|
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-Encoding': 'gzip, deflate, br, zstd',
|
||||||
'Accept-Language': 'es-419,es;q=0.9',
|
'Accept-Language': 'es-419,es;q=0.9',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
@@ -87,16 +88,21 @@ module.exports = {
|
|||||||
'Sec-Fetch-User': '?1',
|
'Sec-Fetch-User': '?1',
|
||||||
'Sec-GPC': 1,
|
'Sec-GPC': 1,
|
||||||
'Upgrade-Insecure-Requests': 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': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
||||||
'sec-ch-ua-mobile': '?0',
|
'sec-ch-ua-mobile': '?0',
|
||||||
'sec-ch-ua-platform': '"Windows"'
|
'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 date = dayjs().tz('America/Argentina/Buenos_Aires')
|
||||||
|
|
||||||
const response = await axios.post(
|
const response = await axios
|
||||||
|
.post(
|
||||||
'https://www.directv.com.ar/guia/guia.aspx/GetProgramming',
|
'https://www.directv.com.ar/guia/guia.aspx/GetProgramming',
|
||||||
{
|
{
|
||||||
filterParam: {
|
filterParam: {
|
||||||
@@ -128,12 +134,13 @@ module.exports = {
|
|||||||
'Sec-Fetch-Mode': 'cors',
|
'Sec-Fetch-Mode': 'cors',
|
||||||
'Sec-Fetch-Site': 'same-origin',
|
'Sec-Fetch-Site': 'same-origin',
|
||||||
'Sec-GPC': 1,
|
'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',
|
'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',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
||||||
'sec-ch-ua-mobile': '?0',
|
'sec-ch-ua-mobile': '?0',
|
||||||
'sec-ch-ua-platform': '"Windows"',
|
'sec-ch-ua-platform': '"Windows"',
|
||||||
'uzlc': true,
|
uzlc: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ module.exports = {
|
|||||||
let channels = []
|
let channels = []
|
||||||
const cookies = await axios.get('https://www.directv.com.uy/guia/guia.aspx', {
|
const cookies = await axios.get('https://www.directv.com.uy/guia/guia.aspx', {
|
||||||
headers: {
|
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-Encoding': 'gzip, deflate, br, zstd',
|
||||||
'Accept-Language': 'es-419,es;q=0.9',
|
'Accept-Language': 'es-419,es;q=0.9',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
@@ -72,16 +73,21 @@ module.exports = {
|
|||||||
'Sec-Fetch-User': '?1',
|
'Sec-Fetch-User': '?1',
|
||||||
'Sec-GPC': 1,
|
'Sec-GPC': 1,
|
||||||
'Upgrade-Insecure-Requests': 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': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
||||||
'sec-ch-ua-mobile': '?0',
|
'sec-ch-ua-mobile': '?0',
|
||||||
'sec-ch-ua-platform': '"Windows"'
|
'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 date = dayjs().tz('America/Montevideo')
|
||||||
|
|
||||||
const response = await axios.post(
|
const response = await axios
|
||||||
|
.post(
|
||||||
'https://www.directv.com.uy/guia/guia.aspx/GetProgramming',
|
'https://www.directv.com.uy/guia/guia.aspx/GetProgramming',
|
||||||
{
|
{
|
||||||
filterParam: {
|
filterParam: {
|
||||||
@@ -113,12 +119,13 @@ module.exports = {
|
|||||||
'Sec-Fetch-Mode': 'cors',
|
'Sec-Fetch-Mode': 'cors',
|
||||||
'Sec-Fetch-Site': 'same-origin',
|
'Sec-Fetch-Site': 'same-origin',
|
||||||
'Sec-GPC': 1,
|
'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',
|
'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',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
'sec-ch-ua': '"Not;A=Brand";v="99", "Brave";v="139", "Chromium";v="139"',
|
||||||
'sec-ch-ua-mobile': '?0',
|
'sec-ch-ua-mobile': '?0',
|
||||||
'sec-ch-ua-platform': '"Windows"',
|
'sec-ch-ua-platform': '"Windows"',
|
||||||
'uzlc': true,
|
uzlc: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ async function fetchToken() {
|
|||||||
'sec-fetch-site': 'same-origin',
|
'sec-fetch-site': 'same-origin',
|
||||||
'x-requested-with': 'XMLHttpRequest',
|
'x-requested-with': 'XMLHttpRequest',
|
||||||
Referer: 'https://www.dishtv.in/channel-guide.html',
|
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)
|
.then(r => r.data)
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ axios.post.mockImplementation((url, data, params) => {
|
|||||||
'sec-fetch-site': 'same-origin',
|
'sec-fetch-site': 'same-origin',
|
||||||
'x-requested-with': 'XMLHttpRequest',
|
'x-requested-with': 'XMLHttpRequest',
|
||||||
Referer: 'https://www.dishtv.in/channel-guide.html',
|
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'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ dayjs.extend(utc)
|
|||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'User-Agent':
|
'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 = {
|
module.exports = {
|
||||||
site: 'elcinema.com',
|
site: 'elcinema.com',
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ module.exports = {
|
|||||||
const data = await axios
|
const data = await axios
|
||||||
.get('https://epg.112114.xyz/pp.xml')
|
.get('https://epg.112114.xyz/pp.xml')
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(e => { console.log(e); return null })
|
.catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
return null
|
||||||
|
})
|
||||||
if (!data) return []
|
if (!data) return []
|
||||||
|
|
||||||
const { channels = [] } = parser.parse(data)
|
const { channels = [] } = parser.parse(data)
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ module.exports = {
|
|||||||
)}&toTime=${date
|
)}&toTime=${date
|
||||||
.add(1, 'days')
|
.add(1, 'days')
|
||||||
.subtract(1, 's')
|
.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: {
|
request: {
|
||||||
async headers({ country } = {}) {
|
async headers({ country } = {}) {
|
||||||
@@ -94,7 +96,8 @@ module.exports = {
|
|||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
const ai = Number(a.site_id)
|
const ai = Number(a.site_id)
|
||||||
const bi = Number(b.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
|
return ai - bi
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -108,8 +111,7 @@ function parseImage(item) {
|
|||||||
|
|
||||||
async function loadSessionDetails() {
|
async function loadSessionDetails() {
|
||||||
try {
|
try {
|
||||||
const r = await axios
|
const r = await axios.post(
|
||||||
.post(
|
|
||||||
'https://api-web.ug-be.cdn.united.cloud/oauth/token?grant_type=client_credentials',
|
'https://api-web.ug-be.cdn.united.cloud/oauth/token?grant_type=client_credentials',
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const channel = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it('can generate valid url', async () => {
|
it('can generate valid url', async () => {
|
||||||
const result = url({ date, channel, country : 'ba' })
|
const result = url({ date, channel, country: 'ba' })
|
||||||
|
|
||||||
expect(result).toBe(
|
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'
|
'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'
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ module.exports = {
|
|||||||
curTag = 'displayName'
|
curTag = 'displayName'
|
||||||
curText = ''
|
curText = ''
|
||||||
// capture possible lang attribute (xml:lang or lang)
|
// 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) => {
|
await new Promise((resolve, reject) => {
|
||||||
res.data
|
res.data.pipe(zlib.createGunzip()).pipe(parserStream).on('end', resolve).on('error', reject)
|
||||||
.pipe(zlib.createGunzip())
|
|
||||||
.pipe(parserStream)
|
|
||||||
.on('end', resolve)
|
|
||||||
.on('error', reject)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return channels.map(channel => {
|
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 {
|
return {
|
||||||
lang: displayName.lang || 'en',
|
lang: displayName.lang || 'en',
|
||||||
site_id: `${tag}#${channel.id}`,
|
site_id: `${tag}#${channel.id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user