diff --git a/sites/startimestv.com/__data__/content.html b/sites/startimestv.com/__data__/content.html new file mode 100644 index 00000000..8f05a785 --- /dev/null +++ b/sites/startimestv.com/__data__/content.html @@ -0,0 +1,977 @@ + + + + + + + + + + + + + + + + + + kui + + + + + + + + + + + + + + + + +
+
+
+
+

ZEE ONE

+
+
+
+
+
+
+ +
+
+

ZEE ONE

+
+ 509553 +
+
+

Rate:

+ +

Category: + Series  

+ DTH: DTH_Smart
DTT: DTT_Classic +
+
+
+

Zee One brings you the best Bollywood telenovelas, movies, series & lifestyle shows. +

+
+
+
+ +
+
+
+ +    00:00   01:00   02:00   03:00   04:00   05:00   06:00   07:00   08:00   09:00   10:00   11:00   12:00   13:00   14:00   15:00   16:00   17:00   18:00   19:00   20:00   21:00   22:00   23:00 +
+
+
+
+ + +
+ +
+

Deserted S1 E37

+
00:00-01:00
+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+
+

00:00-01:00 Deserted S1 E37

+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+ +
+ + +
+ +
+

The Pain Of Loving You S1 E87

+
01:00-02:00
+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+
+

01:00-02:00 The Pain Of Loving You S1 E87

+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+ +
+ + +
+ +
+

Gangaa S2 E74

+
02:00-03:00
+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+
+

02:00-03:00 Gangaa S2 E74

+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+ +
+ + +
+ +
+

Lakshya

+
03:00-05:30
+

A irresponsible and immature young man's life changes forever, after he joins + the army and becomes a battlefield hero.

+
+
+

03:00-05:30 Lakshya

+

A irresponsible and immature young man's life changes forever, after he joins + the army and becomes a battlefield hero.

+
+ +
+ + +
+ +
+

Shonar Bengal S1 E05

+
05:30-06:00
+

Take a look inside Bengal's vibrant culture, delicious food and interesting + destinations with Sumona Chakravarti

+
+
+

05:30-06:00 Shonar Bengal S1 E05

+

Take a look inside Bengal's vibrant culture, delicious food and interesting + destinations with Sumona Chakravarti

+
+ +
+ + +
+ +
+

36 Reasons S1 E78

+
06:00-06:59
+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+
+

06:00-06:59 36 Reasons S1 E78

+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+ +
+ +
+ +
+ +
+

The Pain Of Loving You S1 E87

+
07:00-08:00
+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+
+

07:00-08:00 The Pain Of Loving You S1 E87

+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+ +
+ + +
+ +
+

Gangaa S2 E74

+
08:00-09:00
+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+
+

08:00-09:00 Gangaa S2 E74

+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+ +
+ + +
+ +
+

Deserted S1 E37

+
09:00-10:00
+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+
+

09:00-10:00 Deserted S1 E37

+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+ +
+ + +
+ +
+

36 Reasons S1 E78

+
10:00-11:00
+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+
+

10:00-11:00 36 Reasons S1 E78

+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+ +
+ + +
+ +
+

The Pain Of Loving You S1 E87

+
11:00-12:00
+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+
+

11:00-12:00 The Pain Of Loving You S1 E87

+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+ +
+ + +
+ +
+

Gangaa S2 E74

+
12:00-13:00
+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+
+

12:00-13:00 Gangaa S2 E74

+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+ +
+ + +
+ +
+

Deserted S1 E37

+
13:00-14:00
+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+
+

13:00-14:00 Deserted S1 E37

+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+ +
+ + +
+ +
+

36 Reasons S1 E78

+
14:00-15:00
+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+
+

14:00-15:00 36 Reasons S1 E78

+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+ +
+ + +
+ +
+

Deserted S1 E37

+
15:00-16:00
+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+
+

15:00-16:00 Deserted S1 E37

+

Tora approaches Tubri for help, but she expresses her helplessness in seeking + assistance from Arjun. Meanwhile, other family members are caught in the + crossfire, trying to navigate their own positions within the household.

+
+ +
+ + +
+ +
+

Gangaa S2 E74

+
16:00-17:00
+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+
+

16:00-17:00 Gangaa S2 E74

+

Gangaa is out on the streets? Who will save her from the humiliation she is + facing?

+
+ +
+ + +
+ +
+

36 Reasons S1 E78

+
17:00-18:00
+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+
+

17:00-18:00 36 Reasons S1 E78

+

Amartya suggests Vedant and Amulya to put up an act of being in a + fake relationship to convince Vedant's grandma. Both of them reluctantly + agree. Amulya however, puts forth conditions.

+
+ +
+ + +
+ +
+

The Pain Of Loving You S1 E87

+
18:00-19:00
+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+
+

18:00-19:00 The Pain Of Loving You S1 E87

+

Simple devises a plan to trouble Desho and secure a permanent place for + herself in the office. She secretly removes important papers from a file, + causing Desho to panic.

+
+ +
+ + +
+ +
+

Mehek E07

+
19:00-20:00
+

Norah is devastated to find that Julius has moved on after their breakup. + Mehek's cooking saves the day.

+
+
+

19:00-20:00 Mehek E07

+

Norah is devastated to find that Julius has moved on after their breakup. + Mehek's cooking saves the day.

+
+ +
+ + +
+ +
+

No Entry

+
20:00-22:30
+

Tired of listening to his moralistic pals, Prem a promiscuous married man + introduces his friend to an attractive prostitute for temptation.

+
+
+

20:00-22:30 No Entry

+

Tired of listening to his moralistic pals, Prem a promiscuous married man + introduces his friend to an attractive prostitute for temptation.

+
+ +
+ + +
+ +
+

Shonar Bengal S1 E06

+
22:30-23:00
+

Take a look inside Bengal's vibrant culture, delicious food and interesting + destinations with Sumona Chakravarti

+
+
+

22:30-23:00 Shonar Bengal S1 E06

+

Take a look inside Bengal's vibrant culture, delicious food and interesting + destinations with Sumona Chakravarti

+
+ +
+ + +
+ +
+

36 Reasons S1 E79

+
23:00-00:00
+

Purushottam shows at up Vedant's office to boast about the money he recovered + and for fleecing more money. Amulya cheers Vedant and takes him to a café. +

+
+
+

23:00-00:00 36 Reasons S1 E79

+

Purushottam shows at up Vedant's office to boast about the money he recovered + and for fleecing more money. Amulya cheers Vedant and takes him to a café. +

+
+ +
+ +
+
+
+ + + +
+
+
+
+ + +
+
+ +
+ +
+
+
+ +
+

+
+
+
+
+ + +
+
+

+
+
+ + +
Don't have an account? Sign up
+
+
+ + + + + + + + \ No newline at end of file diff --git a/sites/startimestv.com/startimestv.com.channels.xml b/sites/startimestv.com/startimestv.com.channels.xml index 83f731ab..6eba17bf 100644 --- a/sites/startimestv.com/startimestv.com.channels.xml +++ b/sites/startimestv.com/startimestv.com.channels.xml @@ -1,402 +1,80 @@ - TLC - Fashion TV - EWTN - EUROSPORT NEWS - AMC - CTN - Gospel Music TV - STEB TV - 福建卫视 - ZEE TAMIL - African Swahili - SFR SPORT 4 - Eco TV - TVBC - Parastatal TV - Tele Congo - TVR - GTV - KANAL 7 ST SPORTS PREMIUM HD - GH ONE - Metro TV ETV SA - CISTV - ONE TV - UP TV - DIGITAL CONGO - TM2 + ST MOVIES + GANZA TV ST NOVELA E MAKULA TV RT FRANCE - ID E - DISCOVERY CHANNEL + ST Swahili Plus FILMBOX ACTION - DOCUBOX - RFM TV - GALAXY NEWS CBS JUSTICE - RT - ZEE BOLLYMOVIES - Bukedde TV1 - Bukedde TV2 - Atinka TV - ID F - KTN HOME ST SPORTS ARENA HD - BE TV - CINAF TV - Onua TV - FUFA Tv - CBS REALITY - BRICS TV ST MANIA - SLBC Entertainment + Bliss TV ST AFRIK - KC2 - NCI - NGW P - ST WORLD FOOTBALL P - Star TV SL - KARTOON - Real Madrid TV - Angel TV - AM MOBI - Sanyuka Prime - SLBC - 2STV - 3STONES.TV - Adom TV - AFOREVO TV - AFRICA 24 - AFRICABLE - AFRICA NEWS + ST TOONS + ST Beta Sports + REAL MADRID TV + REMBO PLUS AMC MOVIES - AFRICA SPORTS TV - AFRIQUE MEDIA - Afro Music - Afro Music Concert Afro Novelas AIT AL JAZEERA - AMC P - ANTENNE A - AREA TEN AREWA 24 - AWA TV BABY TV - Balafon TV - Barmedas tv BBC WORLD NEWS - BBS TV - 北京卫视 - BENIE TV - BeTV - BIGGS BLOOMBERG - Bnews1 - BOING - B-ONE Boomerang - BORDER TV - BRAZZERS TV - BTN RWA - BTV Kenya - Bukedde TV - Bukedde 2 - Bunyoro TV - BURKINA INFO - BUSINESS 24 - CANAL2 MOVIES - CANAL J - Cartoon Network - CBEEBIES - CCTV 1 - CCTV 4 - CCTV 6 - CCTV 9 - CCTV 13 - CCTV 娱乐 CGTN - CGTN DOCUMENTARY - Channel 44 - CHANNELS - CHANNEL TEN - CHERIFLA TV - China Movies Channel - CISMEDIA - CITIZEN TV - CLOUDS TV - CNBC - CNC WORLD - CNN - CNN PORTUGAL - Colors - CRTV - CTI Asia + CGTN DOC + COLORS DA VINCI - DBM TV - Digital Congo - DISCOVERY SCI. F - DISNEY CHANNEL - Disney Junior - DOVE TV - 东方卫视 - DREAMIN - DREAMWORKS - DRTV - DW - E!F - E! - EATV - EBONY LIFE - EBRU AFRICA - ECCLESIA TV - elimu TV - EMCI TV - EMMANUEL TV - ESPACE TV ESPN 2 ESPN - E-STARS - E. TV - ETV ROA - EWTN - FACE TV - Family TV - FARIN WATA - FASHIONBOX - FOX P - FOX LIFE - FOX NEWS - France 2 - France 3 - FRANCE 5 - FRANCE 24 E - FRANCE 24 + STAR CHANNEL FUEL TV - GABON TÉLÉVISION - GALAXY tv - GASYSTAR TV - GHANA TV - GLOW TV - GOD - Goodrich - GTV SPORTS PLUS - Gungu TV - HTV - 湖南卫视 - 金鹰卡通 - Hunan World - I-BC - IMPACT TV - INOORO TV - IQRAA - ISI MBIDO - ITV - 浙江卫视 - 江苏卫视 - JIMJAM P JIMJAM - JOY PRIME - K24 - KASS TV - KBC - KBS TV - KINGDOM TV - KISS TV KEN - KISS - KOTV - KTN - KTN NEWS - KTO - MINDSET LEARN - Liberty - LMTV - LOLWE TV - M6 MUSIC - MADANI CHANNEL - Magic - Magic Sports MAMBO TV - MAX TV - MBCI - MBC - MCM TOP - MEGA TV - MELODY DAFRIQUE - MIKUBA TV - Moliere Tv - MSNBC - MUTV - NGC F - NGC P NGC - NGW F - NGW - NBS Star - NBS - NDTV 24x7 - NICKELODEON - NIGBATI TV - NIGEZIE - NINA TV F - Njata TV - NTA LAGOS - NTA E - NTA HAUSA - NTA IGBO - NTA Knowledge - NTA Lagos 10 - NTA NEWS 24 - NTA Parliamentary - NTA SPORTS 24 - NTA YORUBA - NTV KEN - NTV UGA - NEW WORLD CINEMA - NYCE TV - ORISUN - ORTB - ORTM - ORTM 2 - OUEST TV - PASSION NOVELAS - PENTHOUSE BLACK - 凤凰CNE Phoenix Info - PLUS TV AFRICA - PORNHUB TV - PPP TV PBO - RAJ TV - Rave TV - REMA TV - RTA - RTB - RTG - RTGA - RTI1 - RTI2 - LA3 - RTNB - RTNC - RTP Africa - RTP INTERNACIONAL - RTS1 - RWANDA TV - Salam TV - SANYUKA TV - SEN TV - Sibuka Maisha - SIC INTL - SIC NOTICIAS - Silverbird TV - SKY NEWS - SOURCE AFRICA - SPARK TV - ST ADEPA - ST Africa - Star GOLD STAR LIFE - Star Plus - STAR TV - ST BOLLYWOOD - ST BONGO + STAR PLUS 中国影视 ST DADIN KOWA - ST Gospel - ST GUIDE - ST GUIDE F Classica - ST KASI MUSIC ST KIDS ST KUNGFU ST MOVIES PLUS - ST NAIJA - ST NOLLYWOOD F ST NOLLYWOOD PLUS ST NOVELA E ST NOVELA E PLUS - ST NOVELA F - ST NOVELA F PLUS - ST NOVELA P - REMBO TV - ST RISE ST SINO DRAMA ST SPORTS ARENA ST SPORTS FOCUS ST SPORTS LIFE ST SPORTS PREMIUM - Triple P ST SWAHILI - STV ST WORLD FOOTBALL HD ST YORUBA ST ZONE - SUD 1ERE - SUNNA TV - TBC1 - TBC 2 - TBN YETU TCM - TELE 7 - Tele 50 - TELECONGO - TELE CHAD - TFX - 天津卫视 - TDC - Times TV - TIVI5 MONDE - TLN - TNT AFRICA WARNER TV NEXT TOONAMI - TRACE MZIKI - Tumaini TV - TV1 - TV3 Ghana - TV3 Tanzania - TV5 MONDE - STYLE TV - TV 10 - ALBAYAN TV - TVB DRAMA - TV BREIZH - TVC NG - TVCA - TVC NEWS - TVI INTERNATIONAL - TV Imaan - TVM2 - TVM1 - TVM - TV MANA - MIRAMAR - TELESCOLA - TVPLUS - 南方卫视 - TV SUCESSO - TV West - UBC - UBIZNEWS - UTV - TEN URBAN - VISION 4 - VOX AFRICA - WanLuo TV - WAP TV WARNER TV - WASAFI TV - Wazobia TV - WBS - WEST NILE TV W-Sport - ZEE CINEMA ZEE MAGIC ZEE ONE CGTN F - \ No newline at end of file + ST NOVELA F + ST NOVELA F PLUS + TV5 MONDE + Afro Music + AMC P + DISNEY CHANNEL + DISNEY JUNIOR + ST NOVELA P + TLN + diff --git a/sites/startimestv.com/startimestv.com.config.js b/sites/startimestv.com/startimestv.com.config.js index e7434dd2..b97e8738 100644 --- a/sites/startimestv.com/startimestv.com.config.js +++ b/sites/startimestv.com/startimestv.com.config.js @@ -3,108 +3,173 @@ const cheerio = require('cheerio') const dayjs = require('dayjs') const utc = require('dayjs/plugin/utc') const customParseFormat = require('dayjs/plugin/customParseFormat') +const debug = require('debug')('site:startimestv.com') dayjs.extend(utc) dayjs.extend(customParseFormat) +const nworker = 5 + module.exports = { site: 'startimestv.com', days: 2, - url: function ({ channel, date }) { + url({ channel, date }) { return `https://www.startimestv.com/channeldetail/${channel.site_id}/${date.format( 'YYYY-MM-DD' )}.html` }, - parser: function ({ content, date }) { - let programs = [] - const items = parseItems(content) - items.forEach(item => { - const $item = cheerio.load(item) - programs.push({ - title: parseTitle($item), - season: parseSeason($item), - episode: parseEpisode($item), - description: parseDescription($item), - start: parseStart($item, date), - stop: parseStop($item, date) - }) - }) + parser({ content, date }) { + const programs = [] + if (content) { + const $ = cheerio.load(content) + $('.box .mask').toArray() + .forEach(el => { + let title = parseText($(el).find('h4')) + const [s, e] = title.substr(0, title.indexOf(' ')).split('-') || [null, null] + const start = dayjs.utc(`${date.format('YYYY-MM-DD')} ${s}`, 'YYYY-MM-DD HH:nn') + const stop = dayjs.utc(`${date.format('YYYY-MM-DD')} ${e}`, 'YYYY-MM-DD HH:nn') + title = title.substr(title.indexOf(' ') + 1) + const [, season, episode] = title.match(/ S(\d+) E(\d+)/) || [null, null, null] + const description = parseText($(el).find('p')) + programs.push({ + title, + description: description !== 'NA' ? description : null, + season: season ? parseInt(season) : season, + episode: episode ? parseInt(episode) : episode, + start, + stop + }) + }) + } return programs }, async channels() { - const _ = require('lodash') + const channels = {} + const queues = [{ t: 'a', u: 'https://www.startimestv.com/tv_guide.html' }] + await doFetch(queues, (queue, res) => { + // process area-id + if (queue.t === 'a') { + const $ = cheerio.load(res) + $('dd.update-areaID').toArray() + .forEach(el => { + const dd = $(el) + const areaId = dd.attr('area-id') + queues.push({ + t: 's', + u: 'https://www.startimestv.com/tv_guide.html', + params: { + headers: { + cookie: `default_areaID=${areaId}` + } + } + }) + }) + } + // process channel + if (queue.t === 's') { + if (res) { + const $ = cheerio.load(res) + $(`.channl .c`).toArray() + .forEach(el => { + // only process channel with schedule only + const clazz = $(el).attr('class') + const [idx] = clazz.match(/\d+/) || [null] + if (idx && $(`.item.item-${idx} .mask`).length) { + const ch = $(el).find('.pic a[title]') + const [site_id] = ch.attr('href').match(/\d+/) || [null] + if (channels[site_id] === undefined) { + channels[site_id] = { + lang: 'en', + name: ch.attr('title'), + site_id + } + } + } + }) + } + } + }) - const areas = [6, 2, 3, 4, 5, 32, 14, 22, 12, 9, 16, 11, 13, 15, 20, 19] - - const channels = [] - for (let area of areas) { - const data = await axios - .get('https://www.startimestv.com/tv_guide.html', { - headers: { - Cookie: `default_areaID=${area}` - } - }) - .then(r => r.data) - .catch(console.log) - - const $ = cheerio.load(data) - const script = $('body > script:nth-child(10)').html() - let [, json] = script.match(/var obj = eval\( '(.*)' \);/) || [null, null] - json = json.replace(/\\'/g, '') - const items = JSON.parse(json) - - items.forEach(item => { - channels.push({ - lang: 'en', - name: item.name, - site_id: item.id - }) - }) - } - - return _.uniqBy(channels, 'site_id') + return Object.values(channels) } } -function parseStart($item, date) { - const time = $item('.in > .t').text() - const [, HH, mm] = time.match(/^(\d{2}):(\d{2})/) || [null, null, null] +function parseText($item) { + let text = $item.text() + .replace(/\t/g, '') + .replace(/\n/g, ' ') + .trim() + while (true) { + if (text.match(/ /)) { + text = text.replace(/ /g, ' ') + continue + } + break + } - return HH && mm ? dayjs.utc(`${date.format('YYYY-MM-DD')} ${HH}:${mm}`, 'YYYY-MM-DD HH:mm') : null + return text } -function parseStop($item, date) { - const time = $item('.in > .t').text() - const [, HH, mm] = time.match(/(\d{2}):(\d{2})$/) || [null, null, null] +async function doFetch(queues, cb) { + const axios = require('axios') - return HH && mm ? dayjs.utc(`${date.format('YYYY-MM-DD')} ${HH}:${mm}`, 'YYYY-MM-DD HH:mm') : null -} - -function parseSeason($item) { - const title = parseTitle($item) - const [, season] = title.match(/ S(\d+)/) || [null, null] - - return season ? parseInt(season) : null -} - -function parseEpisode($item) { - const title = parseTitle($item) - const [, episode] = title.match(/ E(\d+)/) || [null, null] - - return episode ? parseInt(episode) : null -} - -function parseTitle($item) { - return $item('.in > h3').text() -} - -function parseDescription($item) { - return $item('.in > p').text() -} - -function parseItems(content) { - const $ = cheerio.load(content) - - return $('div.tv_gui > div.list > div > div').toArray() + let n = Math.min(nworker, queues.length) + const workers = [] + const adjustWorker = () => { + if (queues.length > workers.length && workers.length < nworker) { + let nw = Math.min(nworker, queues.length) + if (n < nw) { + n = nw + createWorker() + } + } + } + const createWorker = () => { + while (workers.length < n) { + startWorker() + } + } + const startWorker = () => { + const worker = () => { + if (queues.length) { + const queue = queues.shift() + const done = res => { + if (res) { + cb(queue, res) + adjustWorker() + } + worker() + } + const url = typeof queue === 'string' ? queue : queue.u + const params = typeof queue === 'object' && queue.params ? queue.params : {} + const method = typeof queue === 'object' && queue.m ? queue.m : 'get' + debug(`fetch %s with %s`, url, JSON.stringify(params)) + if (method === 'post') { + axios + .post(url, params) + .then(response => done(response.data)) + .catch(console.error) + } else { + axios + .get(url, params) + .then(response => done(response.data)) + .catch(console.error) + } + } else { + workers.splice(workers.indexOf(worker), 1) + } + } + workers.push(worker) + worker() + } + createWorker() + await new Promise(resolve => { + const interval = setInterval(() => { + if (workers.length === 0) { + clearInterval(interval) + resolve() + } + }, 500) + }) } diff --git a/sites/startimestv.com/startimestv.com.test.js b/sites/startimestv.com/startimestv.com.test.js index 02da6098..836537e6 100644 --- a/sites/startimestv.com/startimestv.com.test.js +++ b/sites/startimestv.com/startimestv.com.test.js @@ -5,7 +5,7 @@ const customParseFormat = require('dayjs/plugin/customParseFormat') dayjs.extend(customParseFormat) dayjs.extend(utc) -const date = dayjs.utc('2022-04-10', 'YYYY-MM-DD').startOf('d') +const date = dayjs.utc('2024-12-10', 'YYYY-MM-DD').startOf('d') const channel = { site_id: '1023102509', xmltv_id: 'ZeeOneAfrica.za' @@ -13,29 +13,30 @@ const channel = { it('can generate valid url', () => { expect(url({ channel, date })).toBe( - 'https://www.startimestv.com/channeldetail/1023102509/2022-04-10.html' + 'https://www.startimestv.com/channeldetail/1023102509/2024-12-10.html' ) }) it('can parse response', () => { - const content = - '

Guddan S2 E77

00:00-01:00

Vickrant is overjoyed to see Akshat in pain and not knowing what to do.

00:00-01:00 Guddan S2 E77

Vickrant is overjoyed to see Akshat in pain and not knowing what to do.

' + const fs = require('fs') + const path = require('path') + const content = fs.readFileSync(path.join(__dirname, '__data__', 'content.html')) const result = parser({ content, date }).map(p => { p.start = p.start.toJSON() p.stop = p.stop.toJSON() return p }) - expect(result).toMatchObject([ - { - start: '2022-04-10T00:00:00.000Z', - stop: '2022-04-10T01:00:00.000Z', - title: 'Guddan S2 E77', - season: 2, - episode: 77, - description: 'Vickrant is overjoyed to see Akshat in pain and not knowing what to do.' - } - ]) + expect(result.length).toBe(22) + expect(result[0]).toMatchObject({ + start: '2024-12-10T00:00:00.000Z', + stop: '2024-12-10T01:00:00.000Z', + title: 'Deserted S1 E37', + description: + 'Tora approaches Tubri for help, but she expresses her helplessness in seeking assistance from Arjun. Meanwhile, other family members are caught in the crossfire, trying to navigate their own positions within the household.', + season: 1, + episode: 37 + }) }) it('can handle empty guide', () => {