From accacfb6d6e5ececf14b34dbe4b5b24d3e7b6386 Mon Sep 17 00:00:00 2001 From: StrangeDrVN Date: Tue, 9 Dec 2025 13:26:20 +0530 Subject: [PATCH] Updated config.js Parses 857 channels. edited baseUrl and initialUrl. removed platform. --- sites/tataplay.com/tataplay.com.config.js | 20 +++++++++----------- sites/tataplay.com/tataplay.com.test.js | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sites/tataplay.com/tataplay.com.config.js b/sites/tataplay.com/tataplay.com.config.js index 777634d8..d7807bb4 100644 --- a/sites/tataplay.com/tataplay.com.config.js +++ b/sites/tataplay.com/tataplay.com.config.js @@ -17,10 +17,9 @@ module.exports = { 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/120.0.0.0 Safari/537.36', + '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', 'content-type': 'application/json', - locale: 'ENG', - platform: 'web' + locale: 'ENG' }, data({ channel }) { return { id: channel.site_id } @@ -53,22 +52,21 @@ module.exports = { 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/120.0.0.0 Safari/537.36', + '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', 'content-type': 'application/json', - locale: 'ENG', - platform: 'web' + locale: 'ENG' } - const baseUrl = 'https://tm.tapi.videoready.tv/portal-search/pub/api/v1/channels/schedule' - const initialUrl = `${baseUrl}?date=&languageFilters=&genreFilters=&limit=20&offset=0` + 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 total = initialResponse.data?.data?.total || 0 const channels = [] - for (let offset = 0; offset < total; offset += 20) { - const url = `${baseUrl}?date=&languageFilters=&genreFilters=&limit=20&offset=${offset}` + for (let offset = 0; offset < total; offset += 1000) { + const url = `${baseUrl}?limit=1000&offset=${offset}` const response = await axios.get(url, { headers }) - const page = response.data?.data?.channelList || [] + const page = response.data?.data?.list || [] channels.push(...page) } diff --git a/sites/tataplay.com/tataplay.com.test.js b/sites/tataplay.com/tataplay.com.test.js index 2f5551af..f994c8cb 100644 --- a/sites/tataplay.com/tataplay.com.test.js +++ b/sites/tataplay.com/tataplay.com.test.js @@ -51,7 +51,7 @@ it('can parse channel list', async () => { data: { data: { total: 2, - channelList: [ + list: [ { id: '1001', title: 'Star Plus',