Repository: yt-dlp/yt-dlp

Issue:
BoxCast.tv - not working.
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.11.11** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [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 I'm willing to share it if required

### Region

USA

### Provide a description that is worded well enough to be understood

Embedded video.  Link of the embed is:
https://boxcast.tv/view-embed/in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx?showTitle=0&showDescription=0&showHighlights=0&showRelated=0&showCountdown=1&market=smb&showDocuments=0&showIndex=0&showDonations=0

Original website link:
https://childrenshealthdefense.eu/live-stream/

When I try the original website, the embedded video is completely ignored.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'https://boxcast.tv/view-embed/in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx?showTitle=0&showDescription=0&showHighlights=0&showRe[2/2]
=0&showCountdown=1&market=smb&showDocuments=0&showIndex=0&showDonations=0']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.11.11 [8b64402] (pip)
[debug] Python 3.10.6 (CPython x86_64 64bit) - Linux-5.15.0-56-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1723 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.11.11, Current version: 2022.11.11
yt-dlp is up to date (2022.11.11)
[debug] [generic] Extracting URL: https://boxcast.tv/view-embed/in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx?showTitle=0&showDescription=0&showHighlights=0&showRelated=0&showCountdown=1&market=smb&showDocuments=0&showIndex=0&showDonations=0
[generic] in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx?showTitle=0&showDescription=0&showHighlights=0&showRelated=0&showCountdown=1&market=smb&showDocuments=0&showIndex=0&showDonations=0: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx?showTitle=0&showDescription=0&showHighlights=0&showRelated=0&showCountdown=1&market=smb&showDocuments=0&showIndex=0&showDonations=0: Extracting information
[debug] Looking for embeds
[debug] Identified a twitter:player iframe
[debug] [generic] Extracting URL: https://boxcast.tv/view-embed/in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx
[generic] in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx: Downloading webpage
ERROR: [generic] Unable to download webpage: Remote end closed connection without response (caused by RemoteDisconnected('Remote end closed connection without response')); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/extractor/common.py", line 674, in extract
    ie_result = self._real_extract(url)
  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/extractor/generic.py", line 2582, in _real_extract
    full_response = self._request_webpage(url, video_id, headers={
  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/extractor/common.py", line 825, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/extractor/common.py", line 807, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 3692, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/home/dev/.local/pipx/venvs/yt-dlp/lib/python3.10/site-packages/yt_dlp/utils.py", line 1527, in https_open
    return self.do_open(
  File "/usr/lib/python3.10/urllib/request.py", line 1352, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
```



Discussion:
For devs: you'll want to add embed detection 

Might be useful: https://support.boxcast.com/en/collections/3117173-embedding-player-settings

Resolving patch:
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
@@ -242,6 +242,7 @@
 from .bongacams import BongaCamsIE
 from .bostonglobe import BostonGlobeIE
 from .box import BoxIE
+from .boxcast import BoxCastVideoIE
 from .booyah import BooyahClipsIE
 from .bpb import BpbIE
 from .br import (
diff --git a/yt_dlp/extractor/boxcast.py b/yt_dlp/extractor/boxcast.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/boxcast.py
@@ -0,0 +1,102 @@
+from .common import InfoExtractor
+from ..utils import (
+    js_to_json,
+    traverse_obj,
+    unified_timestamp
+)
+
+
+class BoxCastVideoIE(InfoExtractor):
+    _VALID_URL = r'''(?x)
+        https?://boxcast\.tv/(?:
+            view-embed/|
+            channel/\w+\?(?:[^#]+&)?b=|
+            video-portal/(?:\w+/){2}
+        )(?P<id>[\w-]+)'''
+    _EMBED_REGEX = [r'<iframe[^>]+src=["\'](?P<url>https?://boxcast\.tv/view-embed/[\w-]+)']
+    _TESTS = [{
+        'url': 'https://boxcast.tv/view-embed/in-the-midst-of-darkness-light-prevails-an-interdisciplinary-symposium-ozmq5eclj50ujl4bmpwx',
+        'info_dict': {
+            'id': 'da1eqqgkacngd5djlqld',
+            'ext': 'mp4',
+            'thumbnail': r're:https?://uploads\.boxcast\.com/(?:[\w+-]+/){3}.+\.png$',
+            'title': 'In the Midst of Darkness Light Prevails: An Interdisciplinary Symposium',
+            'release_timestamp': 1670686812,
+            'release_date': '20221210',
+            'uploader_id': 're8w0v8hohhvpqtbskpe',
+            'uploader': 'Children\'s Health Defense',
+        }
+    }, {
+        'url': 'https://boxcast.tv/video-portal/vctwevwntun3o0ikq7af/rvyblnn0fxbfjx5nwxhl/otbpltj2kzkveo2qz3ad',
+        'info_dict': {
+            'id': 'otbpltj2kzkveo2qz3ad',
+            'ext': 'mp4',
+            'uploader_id': 'vctwevwntun3o0ikq7af',
+            'uploader': 'Legacy Christian Church',
+            'title': 'The Quest | 1: Beginner\'s Bay | Jamie Schools',
+            'thumbnail': r're:https?://uploads.boxcast.com/(?:[\w-]+/){3}.+\.jpg'
+        }
+    }, {
+        'url': 'https://boxcast.tv/channel/z03fqwaeaby5lnaawox2?b=ssihlw5gvfij2by8tkev',
+        'info_dict': {
+            'id': 'ssihlw5gvfij2by8tkev',
+            'ext': 'mp4',
+            'thumbnail': r're:https?://uploads.boxcast.com/(?:[\w-]+/){3}.+\.jpg$',
+            'release_date': '20230101',
+            'uploader_id': 'ds25vaazhlu4ygcvffid',
+            'release_timestamp': 1672543201,
+            'uploader': 'Lighthouse Ministries International  - Beltsville, Maryland',
+            'description': 'md5:ac23e3d01b0b0be592e8f7fe0ec3a340',
+            'title': 'New Year\'s Eve CROSSOVER Service at LHMI | December 31, 2022',
+        }
+    }]
+    _WEBPAGE_TESTS = [{
+        'url': 'https://childrenshealthdefense.eu/live-stream/',
+        'info_dict': {
+            'id': 'da1eqqgkacngd5djlqld',
+            'ext': 'mp4',
+            'thumbnail': r're:https?://uploads\.boxcast\.com/(?:[\w+-]+/){3}.+\.png$',
+            'title': 'In the Midst of Darkness Light Prevails: An Interdisciplinary Symposium',
+            'release_timestamp': 1670686812,
+            'release_date': '20221210',
+            'uploader_id': 're8w0v8hohhvpqtbskpe',
+            'uploader': 'Children\'s Health Defense',
+        }
+    }]
+
+    def _real_extract(self, url):
+        display_id = self._match_id(url)
+        webpage = self._download_webpage(url, display_id)
+        webpage_json_data = self._search_json(
+            r'var\s*BOXCAST_PRELOAD\s*=', webpage, 'broadcast data', display_id,
+            transform_source=js_to_json, default={})
+
+        # Ref: https://support.boxcast.com/en/articles/4235158-build-a-custom-viewer-experience-with-boxcast-api
+        broadcast_json_data = (
+            traverse_obj(webpage_json_data, ('broadcast', 'data'))
+            or self._download_json(f'https://api.boxcast.com/broadcasts/{display_id}', display_id))
+        view_json_data = (
+            traverse_obj(webpage_json_data, ('view', 'data'))
+            or self._download_json(f'https://api.boxcast.com/broadcasts/{display_id}/view',
+                                   display_id, fatal=False) or {})
+
+        formats, subtitles = [], {}
+        if view_json_data.get('status') == 'recorded':
+            formats, subtitles = self._extract_m3u8_formats_and_subtitles(
+                view_json_data['playlist'], display_id)
+
+        return {
+            'id': str(broadcast_json_data['id']),
+            'title': (broadcast_json_data.get('name')
+                      or self._html_search_meta(['og:title', 'twitter:title'], webpage)),
+            'description': (broadcast_json_data.get('description')
+                            or self._html_search_meta(['og:description', 'twitter:description'], webpage)
+                            or None),
+            'thumbnail': (broadcast_json_data.get('preview')
+                          or self._html_search_meta(['og:image', 'twitter:image'], webpage)),
+            'formats': formats,
+            'subtitles': subtitles,
+            'release_timestamp': unified_timestamp(broadcast_json_data.get('streamed_at')),
+            'uploader': broadcast_json_data.get('account_name'),
+            'uploader_id': broadcast_json_data.get('account_id'),
+        }


Test patch: