From 1e0d1101a4a3b0b66e2d09846d4243e7b94e4976 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 26 Nov 2023 16:55:26 +0300
Subject: [PATCH] Update rotana.net
---
sites/rotana.net/readme.md | 39 +++++++++++++++++++++
sites/rotana.net/rotana.net.test.js | 32 +++++++++++------
sites/rotana.net/rotana.net_ar.channels.xml | 32 ++++++++---------
sites/rotana.net/rotana.net_en.channels.xml | 32 ++++++++---------
4 files changed, 92 insertions(+), 43 deletions(-)
create mode 100644 sites/rotana.net/readme.md
diff --git a/sites/rotana.net/readme.md b/sites/rotana.net/readme.md
new file mode 100644
index 00000000..d39318ed
--- /dev/null
+++ b/sites/rotana.net/readme.md
@@ -0,0 +1,39 @@
+# rotana.net
+
+https://rotana.net/ar/streams (Arabic)
+
+https://rotana.net/en/streams (English)
+
+### Download the guide
+
+Arabic:
+
+```sh
+npm run grab -- --site=rotana.net --lang=ar
+```
+
+English:
+
+```sh
+npm run grab -- --site=rotana.net --lang=en
+```
+
+### Update channel list
+
+Arabic:
+
+```sh
+npm run channels:parse -- --config=./sites/rotana.net/rotana.net.config.js --output=./sites/rotana.net/rotana.net_ar.channels.xml --set=lang:ar
+```
+
+English:
+
+```sh
+npm run channels:parse -- --config=./sites/rotana.net/rotana.net.config.js --output=./sites/rotana.net/rotana.net_en.channels.xml --set=lang:en
+```
+
+### Test
+
+```sh
+npm test -- rotana.net
+```
diff --git a/sites/rotana.net/rotana.net.test.js b/sites/rotana.net/rotana.net.test.js
index c2213f15..7fedef29 100644
--- a/sites/rotana.net/rotana.net.test.js
+++ b/sites/rotana.net/rotana.net.test.js
@@ -1,5 +1,3 @@
-// npm run grab -- --site=rotana.net
-
const { parser, url, request } = require('./rotana.net.config.js')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
@@ -11,41 +9,48 @@ dayjs.extend(utc)
const date = dayjs.utc('2023-11-11').startOf('d')
const channel = {
lang: 'en',
- site_id: '640688871275c9aaa905902a',
+ site_id: '439',
xmltv_id: 'RotanaCinemaMasr.sa'
}
const channelAr = {
lang: 'ar',
- site_id: '640688871275c9aaa905902a',
+ site_id: '439',
xmltv_id: 'RotanaCinemaMasr.sa'
}
it('can use defined user agent', () => {
const result = request.headers['User-Agent']
- expect(result).toBe('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 OPR/104.0.0.0')
+ expect(result).toBe(
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 OPR/104.0.0.0'
+ )
})
it('can generate valid english url', () => {
const result = url({ channel, date })
- expect(result).toBe('https://rotana.net/en/streams?channel=640688871275c9aaa905902a')
+ expect(result).toBe('https://rotana.net/en/streams?channel=439')
})
it('can generate valid arabic url', () => {
const result = url({ channel: channelAr, date })
- expect(result).toBe('https://rotana.net/ar/streams?channel=640688871275c9aaa905902a')
+ expect(result).toBe('https://rotana.net/ar/streams?channel=439')
})
it('can parse english response', () => {
const fs = require('fs')
const path = require('path')
- const result = parser({ channel, date, content: fs.readFileSync(path.join(__dirname, '/__data__/content_en.html'))})
+ const result = parser({
+ channel,
+ date,
+ content: fs.readFileSync(path.join(__dirname, '/__data__/content_en.html'))
+ })
expect(result).toMatchObject([
{
start: '2023-11-10T23:00:00.000Z',
stop: '2023-11-11T01:00:00.000Z',
title: 'Harim Karim',
- description: 'Karim and Jihan separate after a year of marriage due to her discovering his betrayal in her home. Karim tries to get his wife back, but she refuses. Karim calls his old colleague Maha to help him. Ho...'
+ description:
+ 'Karim and Jihan separate after a year of marriage due to her discovering his betrayal in her home. Karim tries to get his wife back, but she refuses. Karim calls his old colleague Maha to help him. Ho...'
}
])
})
@@ -54,13 +59,18 @@ it('can parse arabic response', () => {
const fs = require('fs')
const path = require('path')
- const result = parser({ channelAr, date, content: fs.readFileSync(path.join(__dirname, '/__data__/content_ar.html'))})
+ const result = parser({
+ channelAr,
+ date,
+ content: fs.readFileSync(path.join(__dirname, '/__data__/content_ar.html'))
+ })
expect(result).toMatchObject([
{
start: '2023-11-10T23:00:00.000Z',
stop: '2023-11-11T01:00:00.000Z',
title: 'حريم كريم',
- description: 'كريم وجيهان ينفصلا بعد عام من الزواج بسبب اكتشافها لخيانته في منزلها، يحاول كريم استعادة زوجته، لكنها ترفض، فيتصل كريم بزميلته القديمة مها، لتساعده، لكن متاعب تحدث بين مها وزوجها، فتأتي لتعيش مع كريم،...'
+ description:
+ 'كريم وجيهان ينفصلا بعد عام من الزواج بسبب اكتشافها لخيانته في منزلها، يحاول كريم استعادة زوجته، لكنها ترفض، فيتصل كريم بزميلته القديمة مها، لتساعده، لكن متاعب تحدث بين مها وزوجها، فتأتي لتعيش مع كريم،...'
}
])
})
diff --git a/sites/rotana.net/rotana.net_ar.channels.xml b/sites/rotana.net/rotana.net_ar.channels.xml
index 94264893..c3d360c2 100644
--- a/sites/rotana.net/rotana.net_ar.channels.xml
+++ b/sites/rotana.net/rotana.net_ar.channels.xml
@@ -1,16 +1,16 @@
-
-
- الرساله
- قناة رسالة الدولية
- ضحك وبس
- إل بي سي
- رومانس
- روتانا سينما مصر
- روتانا سينما السعودية
- روتانا كلاسيك
- روتانا كليب
- روتانا كوميدي
- روتانا دراما
- روتانا خليجية
- سيدة الشاشة
-
+
+
+ الرساله
+ قناة رسالة الدولية
+ ضحك وبس
+ إل بي سي
+ رومانس
+ روتانا سينما مصر
+ روتانا سينما السعودية
+ روتانا كلاسيك
+ روتانا كليب
+ روتانا كوميدي
+ روتانا دراما
+ روتانا خليجية
+ سيدة الشاشة
+
diff --git a/sites/rotana.net/rotana.net_en.channels.xml b/sites/rotana.net/rotana.net_en.channels.xml
index e71af064..b28cfdcf 100644
--- a/sites/rotana.net/rotana.net_en.channels.xml
+++ b/sites/rotana.net/rotana.net_en.channels.xml
@@ -1,16 +1,16 @@
-
-
- Al Resalah
- Al Resalah International
- Dahk wa Bass
- LBC
- Romance
- Rotana Cinema Masr
- Rotana Cinema KSA
- Rotana Classic
- Rotana Clip
- Rotana Comedy
- Rotana Drama
- Rotana Khalijea HD
- Sayedat Alshasha
-
+
+
+ Al Resalah
+ Al Resalah International
+ Dahk wa Bass
+ LBC
+ Romance
+ Rotana Cinema Masr
+ Rotana Cinema KSA
+ Rotana Classic
+ Rotana Clip
+ Rotana Comedy
+ Rotana Drama
+ Rotana Khalijea HD
+ Sayedat Alshasha
+