Update rotana.net TV guide api.

This site is using cloudflare so user agent must be set as normal browser.

Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
Toha 2023-11-11 15:29:27 +07:00
parent a13b3a158b
commit 8afdb025c7
No known key found for this signature in database
GPG key ID: 2D7AA6389D44DCAB
7 changed files with 576 additions and 94 deletions

View file

@ -0,0 +1,203 @@
<div class="hour">
<div class="bg" id="item-11-11-2023">
<h4 class="big-title text-uppercase mt-0 fadeInRight animated " data-animation-in="fadeInRight"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>السبت</span>
11/11/2023
</h4>
</div>
<div class="iq-accordion iq-accordion-square mt-2">
<div class="iq-accordion-block ">
<div class="iq-accordion-title">
<h5 class="big-title text-uppercase mt-0 fadeInLeft animated" data-animation-in="fadeInLeft"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>02:00
</span>
<span>حريم كريم</span>
</h5>
</div>
<div class="iq-accordion-details" id="" style="display: none;">
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12 ">
<img src="https://imgsrv.rotana.net/spider_storage/1398X1000/1686579733?w=450&amp;fit=max"
loading="lazy" alt="">
</div>
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="iq-blog-detail">
<div class="trending-info">
<div class="row">
<div class="col-md-12 col-12 mb-auto">
<div class="d-md-flex trending-box">
<h5 class="big-title text-uppercase mt-0 fadeInLeft animated"
data-animation-in="fadeInLeft" data-delay-in="0.6"
style="opacity: 1; animation-delay: 0.6s">
حريم كريم
</h5>
</div>
<ul
class="p-0 list-inline d-flex flex-wrap align-items-center mb-3 mt-4 iq_tag-list">
<li class="text-primary text-lable mr-3">
<i class="fa fa-tags" aria-hidden="true"></i>
التصنيف
</li>
<li class="trending-list mr-3">
<a class="title" href="#">كوميديا
</a>
</li>
</ul>
<div class="blog-button">
<button id="modal-open-button" type="button"
class="btn btn-primary button-link" data-toggle="modal"
data-target="#exampleModal"
onclick="throttle(getPlayer_epg, 1000, 'https://hiplayer.hibridcdn.net/l/rotana-cinemamasrdvr',1699653600,1699660800); showCatchUpStatus();">
<i class="ri-tv-line"></i>
الأرشيف
</button>
</div>
<br>
<span>
<p><strong>2h</strong></p>
كريم وجيهان ينفصلا بعد عام من الزواج بسبب اكتشافها لخيانته في منزلها، يحاول كريم استعادة زوجته، لكنها ترفض، فيتصل كريم بزميلته القديمة مها، لتساعده، لكن متاعب تحدث بين مها وزوجها، فتأتي لتعيش مع كريم،...
<br><br>
<span> البلد
:
مصر
</span>
<br>
<span> سنة الإصدار
:
2005
</span>
<br>
<span> التصنيف
:
فيلم
</span>
<br>
<span> اللغة
:
عربي
</span>
<br>
<br>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 ">
<div class="iq-accordion-title">
<h5 class="big-title text-uppercase mt-0 fadeInDown animated" data-animation-in="fadeInDown"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>طاقم العمل</span>
</h5>
</div>
<div class="">
<ul class=" row list-inline mb-0 iq-rtl-direction iq_genres-contents">
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 2">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677279797?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="مصطفى قمر">
</div>
<a href="https://rotana.net/ar/actor-details/1065773">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
مصطفى قمر
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 3">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677296222?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="ياسمين عبدالعزيز">
</div>
<a href="https://rotana.net/ar/actor-details/1073676">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
ياسمين عبدالعزيز
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 4">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677257989?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="داليا البحيري">
</div>
<a href="https://rotana.net/ar/actor-details/1070026">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
داليا البحيري
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 5">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677255054?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="بسمة">
</div>
<a href="https://rotana.net/ar/actor-details/1039904">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
بسمة
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 6">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677284150?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="علا غانم">
</div>
<a href="https://rotana.net/ar/actor-details/1074816">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
علا غانم
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 7">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677288303?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="ريهام عبدالغفور">
</div>
<a href="https://rotana.net/ar/actor-details/1077680">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
ريهام عبدالغفور
</h6>
</div>
</a>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,203 @@
<div class="hour">
<div class="bg" id="item-11-11-2023">
<h4 class="big-title text-uppercase mt-0 fadeInRight animated " data-animation-in="fadeInRight"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>Saturday</span>
11/11/2023
</h4>
</div>
<div class="iq-accordion iq-accordion-square mt-2">
<div class="iq-accordion-block ">
<div class="iq-accordion-title">
<h5 class="big-title text-uppercase mt-0 fadeInLeft animated" data-animation-in="fadeInLeft"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>02:00
</span>
<span>Harim Karim</span>
</h5>
</div>
<div class="iq-accordion-details" id="" style="display: none;">
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12 ">
<img src="https://imgsrv.rotana.net/spider_storage/1398X1000/1686579733?w=450&amp;fit=max"
loading="lazy" alt="1">
</div>
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="iq-blog-detail">
<div class="trending-info">
<div class="row">
<div class="col-md-12 col-12 mb-auto">
<div class="d-md-flex trending-box">
<h5 class="big-title text-uppercase mt-0 fadeInLeft animated"
data-animation-in="fadeInLeft" data-delay-in="0.6"
style="opacity: 1; animation-delay: 0.6s">
Harim Karim
</h5>
</div>
<ul
class="p-0 list-inline d-flex flex-wrap align-items-center mb-3 mt-4 iq_tag-list">
<li class="text-primary text-lable mr-3">
<i class="fa fa-tags" aria-hidden="true"></i>
Genres
</li>
<li class="trending-list mr-3">
<a class="title" href="#">Comedy
</a>
</li>
</ul>
<div class="blog-button">
<button id="modal-open-button" type="button"
class="btn btn-primary button-link" data-toggle="modal"
data-target="#exampleModal"
onclick="throttle(getPlayer_epg, 1000, 'https://hiplayer.hibridcdn.net/l/rotana-cinemamasrdvr',1699653600,1699660800); showCatchUpStatus();">
<i class="ri-tv-line"></i>
Catch up
</button>
</div>
<br>
<span>
<p><strong>2h</strong></p>
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...
<br><br>
<span> Country
:
Egypt
</span>
<br>
<span> Release Year
:
2005
</span>
<br>
<span> Category
:
Movie
</span>
<br>
<span> Language
:
Arabic
</span>
<br>
<br>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 ">
<div class="iq-accordion-title">
<h5 class="big-title text-uppercase mt-0 fadeInDown animated" data-animation-in="fadeInDown"
data-delay-in="0.6" style="opacity: 1; animation-delay: 0.6s">
<span>Cast</span>
</h5>
</div>
<div class="">
<ul class=" row list-inline mb-0 iq-rtl-direction iq_genres-contents">
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 2">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677279797?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Mostafa Amar">
</div>
<a href="https://rotana.net/en/actor-details/1065773">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Mostafa Amar
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 3">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677296222?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Yasmin Abdulaziz">
</div>
<a href="https://rotana.net/en/actor-details/1073676">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Yasmin Abdulaziz
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 4">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677257989?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Dalia Al Beheri">
</div>
<a href="https://rotana.net/en/actor-details/1070026">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Dalia Al Beheri
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 5">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677255054?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Basma">
</div>
<a href="https://rotana.net/en/actor-details/1039904">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Basma
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 6">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677284150?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Ola Ghanem">
</div>
<a href="https://rotana.net/en/actor-details/1074816">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Ola Ghanem
</h6>
</div>
</a>
</div>
</li>
<li class="slide-item col-6 col-lg-2 col-md-4 col-sm-6 col-xs-6 7">
<div class="block-images position-relative watchlist-first">
<div class="img-box">
<img src="https://imgsrv.rotana.net/elcinema_persons/1677288303?w=165&amp;fit=max"
class="img-fluid" loading="lazy" alt="Riham Abdulghafour">
</div>
<a href="https://rotana.net/en/actor-details/1077680">
<div
class="block-description d-flex justify-content-center flex-column text-center cast-small-title">
<h6 class="iq-title">
Riham Abdulghafour
</h6>
</div>
</a>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="rotana.net" lang="ar" xmltv_id="LBC.sa" site_id="LBC-15">LBC</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaAflamPlusHD.sa" site_id="AFLAM-1-1">Rotana Aflam+</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaAmerica.sa" site_id="AMERICA-11">Rotana America</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaCinemaEgypt.eg" site_id="CINEMA-EGY-11">Rotana Cinema Egypt</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaCinemaKSA.sa" site_id="CINEMA-10">Rotana Cinema KSA</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaClassic.sa" site_id="CLASSIC-12">Rotana Classic</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaComedy.sa" site_id="COMEDY-13">Rotana Comedy</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaDrama.sa" site_id="DRAMA-13">Rotana Drama</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaKhalijia.sa" site_id="KHALIJIA-11">Rotana Khalejia</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaKids.sa" site_id="KIDS-12">Rotana Kids</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaPlusHD.sa" site_id="ROTANA-HD-11">Rotana+</channel>
</channels>

View file

@ -1,66 +1,106 @@
const stream = require('stream') const cheerio = require('cheerio')
const csv = require('csv-parser')
const dayjs = require('dayjs') const dayjs = require('dayjs')
const timezone = require('dayjs/plugin/timezone')
const utc = require('dayjs/plugin/utc') const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat') const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(timezone)
dayjs.extend(utc) dayjs.extend(utc)
dayjs.extend(customParseFormat) dayjs.extend(customParseFormat)
const headers = {
'User-Agent': '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'
}
module.exports = { module.exports = {
site: 'rotana.net', site: 'rotana.net',
days: 2, days: 2,
url({ channel }) { url({ channel }) {
return `https://rotana.net/triAssets/uploads/2020/11/${channel.site_id}.csv` return `https://rotana.net/${channel.lang}/streams?channel=${channel.site_id}`
}, },
request: { request: {
method: 'POST' headers,
timeout: 15000
}, },
parser: async function ({ buffer, date }) { parser({ content, date }) {
let programs = [] const programs = []
const items = await parseItems(buffer, date)
const items = parseItems(content, date)
items.forEach(item => { items.forEach(item => {
const start = parseStart(item) const info = item.find('.iq-accordion-block > .iq-accordion-title .big-title span')
const stop = parseStop(item) if (info.length) {
const details = item.find('.trending-info div > span')
const [ time, title ] = info.text().split('\n')
const [ _, duration, description ] = details.text().split('\n')
if (duration) {
const start = dayjs.tz(`${date.format('YYYY-MM-DD')} ${time.trim()}`, 'YYYY-MM-DD HH:mm', 'Asia/Riyadh')
const stop = addDuration(start, duration.trim())
programs.push({ programs.push({
title: item['Arabic Event Name'], title: title.trim(),
category: item['Genre'], description: description.trim(),
description: item['Arabic Extended Description'], start: start.toISOString(),
start: start.toJSON(), stop: stop.toISOString()
stop: stop.toJSON()
}) })
}
}
}) })
return programs return programs
},
async channels({ lang = 'en'}) {
const axios = require('axios')
const options = {headers}
const result = await axios
.get(`https://rotana.net/${lang}/streams`, options)
.then(response => response.data)
.catch(console.error)
const $ = cheerio.load(result)
const items = $('#channels-list a').toArray()
const channels = items.map(item => {
const $item = $(item)
const data = $item.attr('href').match(/channel=([A-Za-z0-9]+)/)
return {
lang,
site_id: data[1],
name: $item.text().trim()
}
})
return channels
} }
} }
function parseStart(item) { function addDuration(date, duration) {
const time = `${item['Start Date']} ${item['Start Time']}` const matches = duration.matchAll(/(\d+)(h|m|s|ms)/g)
while (true) {
return dayjs.utc(time, 'DD/MM/YYYY HH:mm:ss:00') const m = matches.next()
if (!m.value) {
break
}
if (m.value[1] && m.value[2]) {
date = date.add(parseInt(m.value[1]), m.value[2])
}
}
return date
} }
function parseStop(item) { function parseItems(content, date) {
const time = `${item['End Date']} ${item['End Time']}` const result = []
const $ = cheerio.load(content)
return dayjs.utc(time, 'DD/MM/YYYY HH:mm:ss:00') const expectedId = `item-${date.format('DD-MM-YYYY')}`
} let lastId
$('.hour > div').toArray().forEach(item => {
const $item = $(item)
if ($item.hasClass('bg')) {
lastId = $item.attr('id')
} else if ($item.hasClass('iq-accordion') && lastId === expectedId) {
result.push($item)
}
})
function parseItems(buffer, date) { return result
return new Promise(resolve => {
let items = []
const input = new stream.PassThrough()
input.end(buffer)
input
.pipe(csv())
.on('data', data => items.push(data))
.on('end', () => {
items = items.filter(i => i['Start Date'] === date.format('DD/MM/YYYY'))
resolve(items)
})
.on('error', () => {
resolve([])
})
})
} }

View file

@ -1,57 +1,75 @@
// npm run grab -- --site=rotana.net // npm run grab -- --site=rotana.net
const { parser, url } = require('./rotana.net.config.js') const { parser, url, request } = require('./rotana.net.config.js')
const dayjs = require('dayjs') const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc') const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat') const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(customParseFormat) dayjs.extend(customParseFormat)
dayjs.extend(utc) dayjs.extend(utc)
const date = dayjs.utc('2021-11-08', 'YYYY-MM-DD').startOf('d') const date = dayjs.utc('2023-11-11').startOf('d')
const channel = { const channel = {
site_id: 'KHALIJIA-7', lang: 'en',
xmltv_id: 'RotanaKhalejia.sa' site_id: '640688871275c9aaa905902a',
xmltv_id: 'RotanaCinemaMasr.sa'
}
const channelAr = {
lang: 'ar',
site_id: '640688871275c9aaa905902a',
xmltv_id: 'RotanaCinemaMasr.sa'
} }
const buffer =
Buffer.from(`Event ID,Event Name,Arabic Event Name,Start Date,Start Time,End Date,End Time,Short Description,Arabic Short Description,Extended Description,Arabic Extended Description,,Genre,Audio,Video
,حسب الظروف,حسب الظروف بدون تترات - Episode 16,07/11/2021,23:30:00:00,08/11/2021,00:00:00:00,,,,,,Drama,,
,كورة,كورة,08/11/2021,01:30:00:00,08/11/2021,03:00:00:00,,,,,,Generic,,`)
it('can generate valid url', () => { it('can use defined user agent', () => {
const result = url({ channel, date }) const result = request.headers['User-Agent']
expect(result).toBe('https://rotana.net/triAssets/uploads/2020/11/KHALIJIA-7.csv') 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 parse response', done => { it('can generate valid english url', () => {
parser({ date, channel, buffer }) const result = url({ channel, date })
.then(result => { expect(result).toBe('https://rotana.net/en/streams?channel=640688871275c9aaa905902a')
})
it('can generate valid arabic url', () => {
const result = url({ channel: channelAr, date })
expect(result).toBe('https://rotana.net/ar/streams?channel=640688871275c9aaa905902a')
})
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'))})
expect(result).toMatchObject([ expect(result).toMatchObject([
{ {
start: '2021-11-08T01:30:00.000Z', start: '2023-11-10T23:00:00.000Z',
stop: '2021-11-08T03:00:00.000Z', stop: '2023-11-11T01:00:00.000Z',
title: 'كورة', title: 'Harim Karim',
category: 'Generic', 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: ''
} }
]) ])
done()
})
.catch(() => {
done()
})
}) })
it('can handle empty guide', done => { it('can parse arabic response', () => {
parser({ const fs = require('fs')
date, const path = require('path')
channel,
buffer: Buffer.from('<!DOCTYPE html><html><head></head><body></body></html>') const result = parser({ channelAr, date, content: fs.readFileSync(path.join(__dirname, '/__data__/content_ar.html'))})
}) expect(result).toMatchObject([
.then(result => { {
expect(result).toMatchObject([]) start: '2023-11-10T23:00:00.000Z',
done() stop: '2023-11-11T01:00:00.000Z',
}) title: 'حريم كريم',
.catch(() => { description: 'كريم وجيهان ينفصلا بعد عام من الزواج بسبب اكتشافها لخيانته في منزلها، يحاول كريم استعادة زوجته، لكنها ترفض، فيتصل كريم بزميلته القديمة مها، لتساعده، لكن متاعب تحدث بين مها وزوجها، فتأتي لتعيش مع كريم،...'
done() }
}) ])
})
it('can handle empty guide', () => {
const result = parser({
content: '<!DOCTYPE html><html><head></head><body></body></html>',
date,
channel
})
expect(result).toMatchObject([])
}) })

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<!--channel site="rotana.net" lang="ar" xmltv_id="" site_id="64d145ba675a000052006672">ضحك وبس</channel-->
<!--channel site="rotana.net" lang="ar" xmltv_id="" site_id="64d14827675a000052006674">سيدة الشاشة</channel-->
<!--channel site="rotana.net" lang="ar" xmltv_id="" site_id="64fef20e2b0c000080002443">رومانس</channel-->
<channel site="rotana.net" lang="ar" xmltv_id="AlresalahInternationalTV.sa" site_id="64f0a999bf16000061006e65">قناة رسالة الدولية</channel>
<channel site="rotana.net" lang="ar" xmltv_id="AlresalahTV.sa" site_id="649a083daac2436c03013132">الرساله</channel>
<channel site="rotana.net" lang="ar" xmltv_id="LBC.sa" site_id="64068582ebf16a0aed0a1edf">إل بي سي</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaCinemaKSA.sa" site_id="63f7e0715afa14278a00c243">روتانا سينما السعودية</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaCinemaMasr.sa" site_id="640688871275c9aaa905902a">روتانا سينما مصر</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaClassic.sa" site_id="64068827b880d209fb034278">روتانا كلاسيك</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaClip.sa" site_id="6499eaf2b68efd40110cc9c2">روتانا كليب</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaComedy.sa" site_id="640687f2b880d209fb034277">روتانا كوميدي</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaDrama.sa" site_id="64068796b880d209fb034276">روتانا دراما</channel>
<channel site="rotana.net" lang="ar" xmltv_id="RotanaKhalijia.sa" site_id="640685c0ebf16a0aed0a1ee0">روتانا خليجية</channel>
</channels>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<!--channel site="rotana.net" lang="en" xmltv_id="" site_id="64d145ba675a000052006672">Dahk wa Bass</channel-->
<!--channel site="rotana.net" lang="en" xmltv_id="" site_id="64d14827675a000052006674">Sayedat Alshasha</channel-->
<!--channel site="rotana.net" lang="en" xmltv_id="" site_id="64fef20e2b0c000080002443">Romance</channel-->
<channel site="rotana.net" lang="en" xmltv_id="AlresalahInternationalTV.sa" site_id="64f0a999bf16000061006e65">Al Resalah International</channel>
<channel site="rotana.net" lang="en" xmltv_id="AlresalahTV.sa" site_id="649a083daac2436c03013132">Al Resalah</channel>
<channel site="rotana.net" lang="en" xmltv_id="LBC.sa" site_id="64068582ebf16a0aed0a1edf">LBC</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaCinemaKSA.sa" site_id="63f7e0715afa14278a00c243">Rotana Cinema KSA</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaCinemaMasr.sa" site_id="640688871275c9aaa905902a">Rotana Cinema Masr</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaClassic.sa" site_id="64068827b880d209fb034278">Rotana Classic</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaClip.sa" site_id="6499eaf2b68efd40110cc9c2">Rotana Clip</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaComedy.sa" site_id="640687f2b880d209fb034277">Rotana Comedy</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaDrama.sa" site_id="64068796b880d209fb034276">Rotana Drama</channel>
<channel site="rotana.net" lang="en" xmltv_id="RotanaKhalijia.sa" site_id="640685c0ebf16a0aed0a1ee0">Rotana Khalijea HD</channel>
</channels>