diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py index 34c98b537..56b518793 100644 --- a/yt_dlp/extractor/_extractors.py +++ b/yt_dlp/extractor/_extractors.py @@ -570,6 +570,7 @@ DWIE, DWArticleIE, ) +from .dzsecurity import DzsecurityLiveIE from .eagleplatform import ( ClipYouEmbedIE, EaglePlatformIE, diff --git a/yt_dlp/extractor/dzsecurity.py b/yt_dlp/extractor/dzsecurity.py new file mode 100644 index 000000000..21f9b65e6 --- /dev/null +++ b/yt_dlp/extractor/dzsecurity.py @@ -0,0 +1,70 @@ +from yt_dlp.extractor.common import InfoExtractor +from yt_dlp.utils import ExtractorError +import re +from urllib.parse import urlparse + + +class DzsecurityLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?(echoroukonline|ennaharonline)\.com/live(?:-news)?' + + _TESTS = [{ + 'url': 'https://www.echoroukonline.com/live', + 'info_dict': { + 'id': 'echorouktv', + 'title': r're:البث الحي لقناة الشروق تي في \d{4}-\d{2}-\d{2} \d{2}:\d{2}', + 'ext': 'mp4', + 'live_status': 'is_live', + } + }, { + 'url': 'https://www.echoroukonline.com/live-news', + 'info_dict': { + 'id': 'echorouknews', + 'title': r're:البث الحي لقناة الشروق نيوز - آخر أخبار الجزائر \d{4}-\d{2}-\d{2} \d{2}:\d{2}', + 'ext': 'mp4', + 'live_status': 'is_live', + } + }] + + def _real_extract(self, url): + webpage = self._download_webpage(url, url) + + title_match = re.search(r'