Repository: yt-dlp/yt-dlp

Issue:
Daystar support
### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running yt-dlp version **2022.02.04**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that none of provided URLs [violate any copyrights](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and am willing to share it if required

### Region

France

### Example URLs

- Single Video : https://player.daystar.tv/0MTO2ITM


### Description

Hi,
I'd love to be able to download some videos from daystar.com.
Daystar seems to be using the LightCast.com player (seen when you right click on the video).

### Verbose log

```python
yt-dlp -v https://player.daystar.tv/0MTO2ITM
[debug] Command-line config: ['-v', 'https://player.daystar.tv/0MTO2ITM']
[debug] User config "/home/sebastien/.config/yt-dlp.conf": ['--format-sort', '+proto', '--ignore-errors', '--prefer-ffmpeg', '--no-warnings', '--restrict-filenames', '--add-metadata', '--write-auto-sub', '--embed-subs', '--embed-thumbnail', '--embed-metadata', '--sub-lang', 'en,fr,es,de', '--format', 'mp4[height<=?480]/mp4/best', '--output', '%(title)s__%(format_id)s__%(id)s__%(extractor)s.%(ext)s']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.02.04 [c1653e9ef]
[debug] Python version 3.8.10 (CPython 64bit) - Linux-5.13.0-30-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.4.1-static (setts), ffprobe 4.4-1ppa1, phantomjs ., rtmpdump 2.4
[debug] Optional libraries: Cryptodome, secretstorage, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [generic] Extracting URL: https://player.daystar.tv/0MTO2ITM
[generic] 0MTO2ITM: Requesting header
[generic] 0MTO2ITM: Downloading webpage
[generic] 0MTO2ITM: Extracting information
[debug] Looking for video embeds
ERROR: Unsupported URL: https://player.daystar.tv/0MTO2ITM
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1381, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/yt_dlp/YoutubeDL.py", line 1451, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/common.py", line 612, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/generic.py", line 3986, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://player.daystar.tv/0MTO2ITM
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/daystar.py b/yt_dlp/extractor/daystar.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/daystar.py
@@ -0,0 +1,48 @@
+from .common import InfoExtractor
+from ..utils import js_to_json, urljoin
+
+
+class DaystarClipIE(InfoExtractor):
+    IE_NAME = 'daystar:clip'
+    _VALID_URL = r'https?://player\.daystar\.tv/(?P<id>\w+)'
+    _TESTS = [{
+        'url': 'https://player.daystar.tv/0MTO2ITM',
+        'info_dict': {
+            'id': '0MTO2ITM',
+            'ext': 'mp4',
+            'title': 'The Dark World of COVID Pt. 1 | Aaron Siri',
+            'description': 'a420d320dda734e5f29458df3606c5f4',
+            'thumbnail': r're:^https?://.+\.jpg',
+        },
+    }]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+
+        src_iframe = self._search_regex(r'\<iframe[^>]+src="([^"]+)"', webpage, 'src iframe')
+        webpage_iframe = self._download_webpage(
+            src_iframe.replace('player.php', 'config2.php'), video_id, headers={'Referer': src_iframe})
+
+        sources = self._parse_json(self._search_regex(
+            r'sources\:\s*(\[.*?\])', webpage_iframe, 'm3u8 source'), video_id, transform_source=js_to_json)
+
+        formats, subtitles = [], {}
+        for source in sources:
+            file = source.get('file')
+            if file and source.get('type') == 'm3u8':
+                fmts, subs = self._extract_m3u8_formats_and_subtitles(
+                    urljoin('https://www.lightcast.com/embed/', file),
+                    video_id, 'mp4', fatal=False, headers={'Referer': src_iframe})
+                formats.extend(fmts)
+                subtitles = self._merge_subtitles(subtitles, subs)
+        self._sort_formats(formats)
+
+        return {
+            'id': video_id,
+            'title': self._html_search_meta(['og:title', 'twitter:title'], webpage),
+            'description': self._html_search_meta(['og:description', 'twitter:description'], webpage),
+            'thumbnail': self._search_regex(r'image:\s*"([^"]+)', webpage_iframe, 'thumbnail'),
+            'formats': formats,
+            'subtitles': subtitles,
+        }
diff --git a/yt_dlp/extractor/extractors.py b/yt_dlp/extractor/extractors.py
--- a/yt_dlp/extractor/extractors.py
+++ b/yt_dlp/extractor/extractors.py
@@ -348,6 +348,7 @@
     DaumPlaylistIE,
     DaumUserIE,
 )
+from .daystar import DaystarClipIE
 from .dbtv import DBTVIE
 from .dctp import DctpTvIE
 from .deezer import (


Test patch: