Add files via upload

This commit is contained in:
Ismaël Moret
2026-04-15 10:52:28 +02:00
committed by GitHub
parent 67c1a7e45e
commit 9c0093c098
29 changed files with 35200 additions and 2918 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@ module.exports = {
},
parser(context) {
let data = []
let data
try {
const json = JSON.parse(context.content)
const programs = json?.data?.epg || []
@@ -48,24 +48,34 @@ module.exports = {
async channels() {
const headers = {
Accept: '*/*',
Origin: 'https://watch.tataplay.com',
Referer: 'https://watch.tataplay.com/',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0',
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'content-type': 'application/json',
locale: 'ENG'
'accept-encoding': 'gzip, deflate, br, zstd',
'accept-language': 'fr-FR,fr;q=0.6',
'cache-control': 'no-cache',
'pragma': 'no-cache',
'priority': 'u=0, i',
'sec-ch-ua': '"Chromium";v="146", "Not-A.Brand";v="24", "Brave";v="146"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'none',
'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/146.0.0.0 Safari/537.36'
}
const baseUrl = 'https://tm.tapi.videoready.tv/portal-search/pub/api/v1/channels'
const initialUrl = `${baseUrl}?limit=1000&offset=0`
const initialResponse = await axios.get(initialUrl, { headers })
const initialResponse = await axios.get(initialUrl, { headers: headers })
const total = initialResponse.data?.data?.total || 0
const channels = []
for (let offset = 0; offset < total; offset += 1000) {
const url = `${baseUrl}?limit=1000&offset=${offset}`
const response = await axios.get(url, { headers })
const response = await axios.get(url, { headers: headers })
const page = response.data?.data?.list || []
channels.push(...page)
}