Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/icareus.py (Python)

Code before:
        token2 = self._search_regex(
            r"""data\s*:\s*{action:"getAsset".*?token:'([a-f0-9]+)'}""", page,
            "token2", default=None, fatal=False)
        livestream_title = get_element_by_class(
            'unpublished-info-item future-event-title', page)
        metad = self._search_json_ld(page, video_id, default=None)

        duration = None
        thumbnail = None
        if metad:
            title = metad.get('title')
            description = metad.get('description')
            timestamp = metad.get('timestamp')
            thumbnail = traverse_obj(metad, ('thumbnails', 0, 'url'))
        elif token2:
            data = {
                "version": "03",
                "action": "getAsset",
                "organizationId": organization_id,
                "assetId": video_id,
                "languageId": "en_US",
                "userId": "0",
                "token": token2,
            }
            metad = self._download_json(
                base_url + '/icareus-suite-api-portlet/publishing',
                video_id, data=urlencode_postdata(data))
            title = metad.get('name')
            description = metad.get('description')
            timestamp = int_or_none(metad.get('date'), scale=1000)
            duration = int_or_none(metad.get('duration'))
            thumbnail = url_or_none(metad.get('thumbnailMedium'))
        elif livestream_title:  # Recorded livestream
            title = livestream_title
            description = get_element_by_class(
                'unpublished-info-item future-event-description', page)
            timestamp = int_or_none(self._search_regex(
                r"var startEvent\s*=\s*(\d+);", page, "uploadDate",
                fatal=False), scale=1000)
        else:
            self.report_warning("Could not extract metadata", video_id)
            description = None
            timestamp = None

        title = title if title else video_id
        description = clean_html(description)

        data = {
            "version": "03",
            "action": "getAssetPlaybackUrls",
            "organizationId": organization_id,

Review comment (suggestion):
```suggestion
                f'{base_url}/icareus-suite-api-portlet/publishing',
```

Code after:
                'assetId': video_id,
                'token': self._search_regex(r"_icareus\['token'\]\s*=\s*'([a-f0-9]+)'", webpage, 'icareus_token'),
            }))

        subtitles = {
            remove_end(sdesc.split(' ')[0], ':'): [{'url': url_or_none(surl)}]
            for _, sdesc, surl in assets.get('subtitles') or []
        }

        formats = [{
            'format': item.get('name'),
            'format_id': 'audio',
            'vcodec': 'none',
            'url': url_or_none(item['url']),
            'tbr': int_or_none(self._search_regex(
                r'\((\d+)\s*k\)', item.get('name') or '', 'audio bitrate', default=None)),
        } for item in assets.get('audio_urls') or [] if url_or_none(item.get('url'))]

        for item in assets.get('urls') or []:
            video_url = url_or_none(item.get('url'))
            if video_url is None:
                continue
            ext = determine_ext(video_url)
            if ext == 'm3u8':
                fmts, subs = self._extract_m3u8_formats_and_subtitles(
                    video_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
                formats.extend(fmts)
                self._merge_subtitles(subs, target=subtitles)
            else:
                fmt = item.get('name')
                formats.append({
                    'url': video_url,
                    'format': fmt,
                    'tbr': parse_bitrate(fmt),
                    'format_id': str_or_none(item.get('id')),
                    **parse_resolution(fmt),
                })

        info, token, live_title = self._search_json_ld(webpage, video_id, default={}), None, None
        if not info:
            token = self._search_regex(
                r'data\s*:\s*{action:"getAsset".*?token:\'([a-f0-9]+)\'}', webpage, 'token', default=None)
            if not token:
                live_title = get_element_by_class('unpublished-info-item future-event-title', webpage)

        if token:
            metadata = self._download_json(
                f'{base_url}/icareus-suite-api-portlet/publishing',
                video_id, fatal=False, data=urlencode_postdata({
                    'version': '03',
                    'action': 'getAsset',