From dea1656a3738650a3b22314932301c3a5941b98d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:31 +0300 Subject: [PATCH 1/6] Create awilime.com.test.js --- sites/awilime.com/awilime.com.test.js | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sites/awilime.com/awilime.com.test.js diff --git a/sites/awilime.com/awilime.com.test.js b/sites/awilime.com/awilime.com.test.js new file mode 100644 index 00000000..df3677fe --- /dev/null +++ b/sites/awilime.com/awilime.com.test.js @@ -0,0 +1,49 @@ +const { parser, url, request } = require('./awilime.com.config.js') +const fs = require('fs') +const path = require('path') +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const customParseFormat = require('dayjs/plugin/customParseFormat') +dayjs.extend(customParseFormat) +dayjs.extend(utc) + +const date = dayjs.utc('2024-06-26', 'YYYY-MM-DD').startOf('d') +const channel = { + site_id: 'budapest_europa_tv', + xmltv_id: 'BudapestEuropaTelevizio.hu' +} + +it('can generate valid url', () => { + expect(url({ channel, date })).toBe( + 'https://www.awilime.com/tv/napi_musor/budapest_europa_tv/2024_06_26' + ) +}) + +it('can parse response', () => { + const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html')) + const results = parser({ content, date }).map(p => { + p.start = p.start.toJSON() + p.stop = p.stop.toJSON() + return p + }) + + expect(results.length).toBe(15) + + expect(results[3]).toMatchObject({ + start: '2024-06-26T07:00:00.000Z', + stop: '2024-06-26T08:00:00.000Z', + title: 'Ébredés', + sub_title: 'Amerikai dokumentumfilm (2018)', + description: 'Balla Tibor misszionárius' + }) +}) + +it('can handle empty guide', () => { + const result = parser({ + date, + channel, + content: + 'Object moved

Object moved to here.

' + }) + expect(result).toMatchObject([]) +}) From df0b4bda25297d5b94d497476a460aff56b71075 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:35 +0300 Subject: [PATCH 2/6] Create content.html --- sites/awilime.com/__data__/content.html | 755 ++++++++++++++++++++++++ 1 file changed, 755 insertions(+) create mode 100644 sites/awilime.com/__data__/content.html diff --git a/sites/awilime.com/__data__/content.html b/sites/awilime.com/__data__/content.html new file mode 100644 index 00000000..ff420213 --- /dev/null +++ b/sites/awilime.com/__data__/content.html @@ -0,0 +1,755 @@ + + + + + + + + + + + + + + + + + + Budapest Európa TV napi műsora 2024. június 26. szerda - awilime magazin + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
Menü betöltése...
+
+
+
+ +
+
+
+ »TV műsor»Napi műsor»Budapest Európa TV napi műsora 2024. június 26. szerda +
+
+
+ +
+ +
+
Bejelentkezés
+
+
+
+
+
+ Várj... +
+
+
+
+ +
+
E-mail:
+
+
+
+
Jelszó:
+
+
+ +
+
+
Bejelentkezés
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ Adatok mentése... +
+
+
+ TV csatorna sorszáma +
+ Itt megadhatod, hogy a TV-dben hányas sorszám alatt látható ez a csatorna:
+
+
+
+
+
+ Budapest Európa TV +
?
+
+
+
+ +
+ +
+
+
+

Budapest Európa TV napi műsora 2024. június 26. szerda

+ +
+
+ 00:00 + A biblia napi igéjeTakács Ferenc misszionárius műsora7 (2) +

Takács Ferenc misszionárius

+
+
Budapest Európa TV reggeli, délelőtti műsora
+
+
+ 07:45 + Nem vagy egyedülTakács Ferenc missionárius műsora7,5 (2) +

Takács Ferenc misszionárius

+
+
+
+ 08:00 + Igehirdetés5,5 (2) +

Baranyi László Zsolt igehirdető

+
+
+
+ 09:00 ÉbredésAmerikai dokumentumfilm (2018)4 (3) +

Balla Tibor misszionárius

+
+
+
+ 10:00 + Csak beszélgetekDr.Bródy Péter műsora7 (2) +

Dr.Bródy Péter beszélgetése

+
+
+
+ 11:00 + SikerpódiumHorváth Gyöngyi zenés műsora1 (1) +

Horváth Gyöngyi

+
+
Budapest Európa TV délutáni műsora
+
+
+ 12:00 + Jó ebédhez jó a nóta6 (2) +

PÁSZTORKA Sándor húzza a talpalávalót

+
+
+ + + +
+
+
+ 13:00 + Így kettenGéczy Dorottya műsora7,5 (2) +

Géczi Dorottya találkozása színházi emberekkel

+
+
+
+ 14:00 + A bünüldözés mestereiDr. Martinkó Károly rendőrségi műsora7,5 (2) +

Rendőrségi műsor

+
+
+
+ 15:00 + SzínésztársalgóSzilágyi Tibor műsora8 (2) +

Szilágyi Tibor színészkollágái

+
+
+
+ 17:00 + Így kettenGéczy Dorottya műsora7,5 (2) +

Géczy Dorottya

+
+
Budapest Európa TV esti, éjszakai műsora
+
+
+ 18:30 MesezugBalatoni Blázsi Marika, Wels Diána műsora7 (2) +

Ricsi bohóc mesél

+
+
+ + + +
+
+
+ 19:00 + NótakincsBalatoni Blázsi Marika műsora7,5 (2) +

Nóták

+
+
+
+ 20:00 + Szól az Opera7 (2) +

Bihari Zsuzsanna énekművész - ismétlés

+
+
+
+ 22:00 ÉbredésAmerikai dokumentumfilm (2018)4 (3) +

Balla Tibor misszionárius

+
+ +
+
+ + + + +
+
+
+ Oszd meg ezt az oldalt: Budapest Európa TV napi műsora 2024. június 26. szerda +
+
+

Facebook
+

Twitter
+

Viber
+

Messenger
+

WhatsApp
+

Telegram
+

Skype
+

Blogger
+

Flipboard
+

LinkedIn
+

Reddit
+

Buffer
+

E-mail
+

Gmail
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+
+
+
2024. június
+
+
12
+
3456789
+
10111213141516
+
17181920212223
+
24252627282930
+
+
+
+
HKSzCsPSzV
+
+
+ + + + From 85a9758533c8edeb645968cf117977025574adcb Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:40 +0300 Subject: [PATCH 3/6] Create awilime.com.config.js --- sites/awilime.com/awilime.com.config.js | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sites/awilime.com/awilime.com.config.js diff --git a/sites/awilime.com/awilime.com.config.js b/sites/awilime.com/awilime.com.config.js new file mode 100644 index 00000000..1617df02 --- /dev/null +++ b/sites/awilime.com/awilime.com.config.js @@ -0,0 +1,86 @@ +const cheerio = require('cheerio') +const axios = require('axios') +const { DateTime } = require('luxon') + +module.exports = { + site: 'awilime.com', + days: 2, + url({ channel, date }) { + return `https://www.awilime.com/tv/napi_musor/${channel.site_id}/${date.format('YYYY_MM_DD')}` + }, + parser({ content, date }) { + const programs = [] + const items = parseItems(content) + items.forEach(item => { + const prev = programs[programs.length - 1] + const $item = cheerio.load(item) + let start = parseStart($item, date) + if (!start) return + if (prev) { + prev.stop = start + } + const stop = start.plus({ minute: 30 }) + + programs.push({ + title: parseTitle($item), + sub_title: parseSubTitle($item), + description: parseDescription($item), + start, + stop + }) + }) + + return programs + }, + async channels() { + const html = await axios + .get('https://www.awilime.com/tv/napi_musor') + .then(r => r.data) + .catch(console.log) + const $ = cheerio.load(html) + const items = $('#body > div.tk > div > div').toArray() + + const channels = [] + items.forEach(item => { + const name = $(item).find('a').text().trim() + const url = $(item).find('a').attr('href') + const [, site_id] = url.match(/\/tv\/napi_musor\/(.*)/) || [null, null] + if (!site_id) return + if (channels.find(channel => channel.site_id === site_id)) return + + channels.push({ + lang: 'hu', + site_id, + name + }) + }) + + return channels + } +} + +function parseTitle($item) { + return $item('b > a').text().trim() +} + +function parseSubTitle($item) { + return $item('i').clone().children().remove('s').end().text().trim() +} + +function parseDescription($item) { + return $item('p').text().trim() +} + +function parseStart($item, date) { + let time = $item('b').clone().children().remove().end().text().trim() + if (!time || !/^\d/.test(time)) return null + time = `${date.format('YYYY-MM-DD')} ${time}` + + return DateTime.fromFormat(time, 'yyyy-MM-dd HH:mm', { zone: 'Europe/Budapest' }).toUTC() +} + +function parseItems(content) { + const $ = cheerio.load(content) + + return $('#body > div.tdc > div.td2 > div').toArray() +} From 2d6a5e0fd2b694ba3711a88eceb4851c4e129df3 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:45 +0300 Subject: [PATCH 4/6] Create awilime.com.channels.xml --- sites/awilime.com/awilime.com.channels.xml | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sites/awilime.com/awilime.com.channels.xml diff --git a/sites/awilime.com/awilime.com.channels.xml b/sites/awilime.com/awilime.com.channels.xml new file mode 100644 index 00000000..4012ed05 --- /dev/null +++ b/sites/awilime.com/awilime.com.channels.xml @@ -0,0 +1,114 @@ + + + AMCnapiheti + Animal Planet HDnapiheti + Arena4napiheti + ATVnapiheti + ATV Spiritnapiheti + AXNnapiheti + Budapest Európa TVnapiheti + Cartoon Networknapiheti + Cartoonitonapiheti + CineMaxnapiheti + CineMax 2napiheti + Comedy Centralnapiheti + Comedy Central Familynapiheti + Coolnapiheti + D1 TVnapiheti + Dikh TVnapiheti + Discovery Channelnapiheti + Disney Csatornanapiheti + Duck TV HDnapiheti + Duck TV Plusnapiheti + Duck TV SDnapiheti + Duna Televíziónapiheti + Duna Worldnapiheti + Epic Dramanapiheti + Eurosport 1napiheti + Eurosport 2napiheti + EWTNnapiheti + film+napiheti + Film4napiheti + Film Cafénapiheti + Film Mánianapiheti + Filmboxnapiheti + Filmbox Extra HDnapiheti + Filmbox Familynapiheti + Filmbox Prémiumnapiheti + FilmBox Starsnapiheti + Fishing and Huntingnapiheti + Food Networknapiheti + Galaxy4napiheti + Hatoscsatornanapiheti + HBOnapiheti + HBO 2napiheti + HBO 3napiheti + HGTV Home & Gardennapiheti + hír TVnapiheti + Historynapiheti + ID Investigation Discoverynapiheti + ID Xtranapiheti + Izaura TVnapiheti + Jazz TVnapiheti + Jim Jamnapiheti + Jocky TVnapiheti + Kölyök klubnapiheti + LifeTVnapiheti + m1napiheti + m2napiheti + m4 sportnapiheti + m4 sport+napiheti + m5napiheti + Magyar Mozi TVnapiheti + Match4napiheti + Max4napiheti + Minimaxnapiheti + Mozi+napiheti + Mozi klubnapiheti + Moziverzumnapiheti + MTV Europeannapiheti + Muzsika TVnapiheti + National Geographic HDnapiheti + National Geographic Wildnapiheti + Nick Jr.napiheti + Nickelodeonnapiheti + Nicktoonsnapiheti + OzoneTVnapiheti + Paramount Networknapiheti + PAX TVnapiheti + Primenapiheti + RTLnapiheti + RTL GOLDnapiheti + RTL HÁROMnapiheti + RTL KETTŐnapiheti + RTL OTTHONnapiheti + Sláger TVnapiheti + Sorozat+napiheti + Sorozat klubnapiheti + Spektrum HDnapiheti + Spektrum Homenapiheti + Spíler1 TVnapiheti + Spíler2 TVnapiheti + Sport 1napiheti + Sport 2napiheti + Story4napiheti + SuperTV2napiheti + TeenNicknapiheti + TLCnapiheti + Travel Channelnapiheti + TV2napiheti + TV2 Comedynapiheti + TV2 Kidsnapiheti + TV2 Klubnapiheti + TV2 Séfnapiheti + TV4napiheti + tv paprikanapiheti + Viasat 2napiheti + Viasat 3napiheti + Viasat 6napiheti + Viasat Explorenapiheti + Viasat Filmnapiheti + Viasat Historynapiheti + Viasat Naturenapiheti + Zenebutiknapiheti + From 241ffe358bf1c0e0d0e4b942026d0040afa15ee7 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:50 +0300 Subject: [PATCH 5/6] Create readme.md --- sites/awilime.com/readme.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 sites/awilime.com/readme.md diff --git a/sites/awilime.com/readme.md b/sites/awilime.com/readme.md new file mode 100644 index 00000000..d28b690a --- /dev/null +++ b/sites/awilime.com/readme.md @@ -0,0 +1,21 @@ +# awilime.com + +https://www.awilime.com/tv/musor + +### Download the guide + +```sh +npm run grab -- --site=awilime.com +``` + +### Update channel list + +```sh +npm run channels:parse -- --config=./sites/awilime.com/awilime.com.config.js --output=./sites/awilime.com/awilime.com.channels.xml +``` + +### Test + +```sh +npm test -- awilime.com +``` From 9fbc6f4aa3278b74cb3eda7f3c17e6afe784ea3d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:21:54 +0300 Subject: [PATCH 6/6] Update SITES.md --- SITES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SITES.md b/SITES.md index 64fd3c90..9aa03c41 100644 --- a/SITES.md +++ b/SITES.md @@ -14,6 +14,7 @@ | [arianatelevision.com](sites/arianatelevision.com) | 🟢 | | | [arirang.com](sites/arirang.com) | 🟢 | | | [artonline.tv](sites/artonline.tv) | 🟢 | | +| [awilime.com](sites/awilime.com) | 🟢 | | | [bein.com](sites/bein.com) | 🟢 | | | [beinsports.com](sites/beinsports.com) | 🟢 | | | [berrymedia.co.kr](sites/berrymedia.co.kr) | 🟢 | |