1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-13 16:08:29 +00:00
This commit is contained in:
CasperMcFadden95 2025-08-12 20:25:36 -03:00 committed by GitHub
commit 9b20779efb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 2 deletions

View File

@ -1745,7 +1745,10 @@
RoosterTeethSeriesIE,
)
from .rottentomatoes import RottenTomatoesIE
from .roya import RoyaLiveIE
from .roya import (
RoyaIE,
RoyaLiveIE,
)
from .rozhlas import (
MujRozhlasIE,
RozhlasIE,

View File

@ -1,6 +1,39 @@
from .common import InfoExtractor
from ..utils.traversal import traverse_obj
ticket_api_base = 'https://ticket.roya-tv.com/api/v5'
class RoyaIE(InfoExtractor):
_VALID_URL = r'https?://(?:en\.)?roya\.tv/videos/(?P<id>\d+)'
_TESTS = [{
'url': 'https://en.roya.tv/videos/110671',
'info_dict': {
'id': '110671',
'title': 'حلوة يا دنيا - الاستضافات صالح مرقة نائب رئيس ملتقى الاعمال الفلسطيني الاردنيً',
'ext': 'mp4',
},
}, {
'url': 'https://roya.tv/videos/0',
'only_matching': True,
}]
def _real_extract(self, url):
media_id = self._match_id(url)
stream_url = self._download_json(
f'{ticket_api_base}/video/{media_id}/ticket', media_id)['data']['secured_url']
webpage = self._download_webpage(url, media_id)
watch_for_free_text = ' | شاهد مجانا'
title = self._html_extract_title(webpage).replace(watch_for_free_text, '')
return {
'id': media_id,
'formats': self._extract_m3u8_formats(stream_url, media_id, 'mp4', m3u8_id='hls', live=False),
'title': title,
}
class RoyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://(?:en\.)?roya\.tv/live-stream/(?P<id>\d+)'
@ -29,7 +62,7 @@ def _real_extract(self, url):
media_id = self._match_id(url)
stream_url = self._download_json(
f'https://ticket.roya-tv.com/api/v5/fastchannel/{media_id}', media_id)['data']['secured_url']
f'{ticket_api_base}/fastchannel/{media_id}', media_id)['data']['secured_url']
title = traverse_obj(
self._download_json('https://backend.roya.tv/api/v01/channels/schedule-pagination', media_id, fatal=False),