diff --git a/sites/bein.com/bein.com.config.js b/sites/bein.com/bein.com.config.js index 898ea225..463e1026 100644 --- a/sites/bein.com/bein.com.config.js +++ b/sites/bein.com/bein.com.config.js @@ -1,3 +1,5 @@ +const axios = require('axios') +const dayjs = require('dayjs') const cheerio = require('cheerio') const { DateTime } = require('luxon') @@ -50,6 +52,35 @@ module.exports = { }) return programs + }, + async channels({ lang }) { + const categories = ['entertainment', 'sports'] + + let channels = [] + for (let category of categories) { + const url = `https://www.bein.com/en/epg-ajax-template/?action=epg_fetch&offset=0&category=${category}&serviceidentity=bein.net&mins=00&cdate=${dayjs().format( + 'YYYY-MM-DD' + )}&language=${lang.toUpperCase()}&postid=25356&loadindex=0` + const data = await axios + .get(url) + .then(r => r.data) + .catch(console.log) + + const $ = cheerio.load(data) + $('.container-tvguide > div').each((i, el) => { + const id = $(el).attr('id') + if (!id || !/^channels_\d+/.test(id)) return + const [, channelId] = id.split('_') + + channels.push({ + lang, + site_id: `${category}#${channelId}`, + name: channelId + }) + }) + } + + return channels } } diff --git a/sites/bein.com/bein.com.test.js b/sites/bein.com/bein.com.test.js index 0525afb0..d571fb0d 100644 --- a/sites/bein.com/bein.com.test.js +++ b/sites/bein.com/bein.com.test.js @@ -1,3 +1,5 @@ +// npm run channels:parse -- --config=./sites/bein.com/bein.com.config.js --output=./sites/bein.com/bein.com_ar.channels.xml --set=lang:ar +// npm run channels:parse -- --config=./sites/bein.com/bein.com.config.js --output=./sites/bein.com/bein.com_en.channels.xml --set=lang:en // npm run grab -- --site=bein.com const fs = require('fs') diff --git a/sites/bein.com/bein.com_ar.channels.xml b/sites/bein.com/bein.com_ar.channels.xml index 95a0d070..51e78aa5 100644 --- a/sites/bein.com/bein.com_ar.channels.xml +++ b/sites/bein.com/bein.com_ar.channels.xml @@ -1,79 +1,82 @@ - - - Al Jazeera Documentary - Alkass Eight - Alkass Five - Alkass Four - Alkass One - Alkass Seven - Alkass Six - Alkass Three - Alkass Two - Baby TV - Baraem - BBC Earth - BeIn 4K - beIN Drama 1 - beIN Gourmet - beIN Movies Premiere - beIN Movies Action - bein Movies Drama - beIN Movies Family - beIN Series 1 - beIN Series 2 - BeIn Sports - BeIn Sports 1 - BeIn Sports 2 - BeIn Sports 3 - BeIn Sports 4 - BeIn Sports 5 - BeIn Sports 6 - BeIn Sports 7 - BeIN Sports AFC - BeIN Sports AFC 1 - BeIN Sports AFC 2 - BeIN Sports AFC 3 - BeIn Sports English 1 - BeIn Sports English 2 - BeIn Sports English 3 - BeIn Sports French 1 - BeIn Sports French 2 - BeIn Sports French 3 - beIN Sports Max 1 - beIN Sports Max 2 - beIN Sports Max 3 - beIN Sports Max 4 - beIN Sports Max 5 - beIN Sports Max 6 - BeIn NBA - BeIn Sports News - BeIn Sports Premium 1 - BeIn Sports Premium 2 - BeIn Sports Premium 3 - BeIn Sports Xtra 1 - BeIn Sports Xtra 2 - be Junior - Bloomberg TV - Cartoon Network Arabic - Cartoon Network Hindi - Cartoon Network - CBeebies - Club MTV - CNN - DreamWorks - EuroNews - Fatafeat - Food Network - FOX Action Movies - FOX - FOX Movies - HGTV - Jeem - MTV 80s - MTV 90s - National Geographic - National Geographic Wild - Star Movies - Star World - Travel Channel - \ No newline at end of file + + + 26 + 40 + 37 + 36 + 41 + 34 + 39 + 38 + 33 + 35 + 32 + 30 + 25 + 15 + 10 + 11 + 1 + 2 + 3 + 4 + 8 + 9 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 23 + 1 + 10 + 11 + 12 + 13 + 14 + 21 + 22 + 38 + 34 + 35 + 33 + 31 + 20 + 27 + 36 + 37 + 28 + 17 + 14 + 6 + 13 + 5 + 15 + 29 + 18 + 19 + 23 + 24 + 7 + 16 + 12 + diff --git a/sites/bein.com/bein.com_en.channels.xml b/sites/bein.com/bein.com_en.channels.xml index 29561d50..8d0de082 100644 --- a/sites/bein.com/bein.com_en.channels.xml +++ b/sites/bein.com/bein.com_en.channels.xml @@ -1,80 +1,84 @@ - - - Alkass Eight - Alkass Five - Alkass Four - Alkass One - Alkass Seven - Alkass Six - Alkass Three - Alkass Two - Baby TV - Baraem - BBC Earth - BeIn 4K - beIN Drama 1 - beIN Gourmet - beIN Movies Premiere - beIN Movies Action - bein Movies Drama - beIN Movies Family - beIN Series 1 - beIN Series 2 - BeIn Sports - BeIn Sports 1 - BeIn Sports 2 - BeIn Sports 3 - BeIn Sports 4 - BeIn Sports 5 - BeIn Sports 6 - BeIn Sports 7 - BeIN Sports AFC - BeIN Sports AFC 1 - BeIN Sports AFC 2 - BeIN Sports AFC 3 - BeIn Sports English 1 - BeIn Sports English 2 - BeIn Sports English 3 - BeIn Sports French 1 - BeIn Sports French 2 - BeIn Sports French 3 - beIN Sports Max 1 - beIN Sports Max 2 - beIN Sports Max 3 - beIN Sports Max 4 - beIN Sports Max 5 - beIN Sports Max 6 - BeIn NBA - BeIn Sports News - BeIn Sports Premium 1 - BeIn Sports Premium 2 - BeIn Sports Premium 3 - BeIn Sports Xtra 1 - BeIn Sports Xtra 2 - be Junior - Bloomberg TV - Cartoon Network Arabic - Cartoon Network Hindi - Cartoon Network - CBeebies - Club MTV - CNN - Discovery - DreamWorks - EuroNews - Fatafeat - Food Network - FOX Action Movies - FOX - FOX Life - FOX Movies - HGTV - Jeem - MTV 80s - MTV 90s - National Geographic - National Geographic Wild - Star Movies - Star World - Travel Channel - + + + 40 + 43 + 37 + 36 + 41 + 33 + 39 + 38 + 42 + 35 + 34 + 35 + 31 + 25 + 15 + 10 + 11 + 1 + 2 + 3 + 4 + 8 + 9 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 23 + 1 + 10 + 11 + 12 + 13 + 14 + 29 + 22 + 38 + 33 + 34 + 32 + 36 + 21 + 26 + 28 + 37 + 27 + 17 + 14 + 6 + 13 + 18 + 5 + 15 + 30 + 19 + 20 + 23 + 24 + 7 + 16 + 12 +