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

Code before:
            'description': 'md5:1b8a103a5d67a3c48d07c065de7e2c63',
            'duration': 83,
            'like_count': int,
            'live_status': 'not_live',
            'media_type': 'video',
            'playable_in_embed': True,
            'tags': 'count:10',
            'thumbnail': r're:https?://i\.ytimg\.com/vi/.+',
            'timestamp': 1754427291,
            'upload_date': '20250805',
            'uploader': 'Bombass Team',
            'uploader_id': '@BombassTeam',
            'uploader_url': 'https://www.youtube.com/@BombassTeam',
            'view_count': int,
        },
        'add_ie': ['Youtube'],
        'params': {'skip_download': 'm3u8'},
    }]

    def _real_extract(self, url):
        file_id = self._match_id(url)
        webpage = self._download_webpage(url, file_id)

        flashvars = self._search_json(
            r'var\s+rgMovieFlashvars\s*=', webpage, 'flashvars',
            file_id, fatal=False, default={}, transform_source=js_to_json)
        youtube_id = (
            traverse_obj(flashvars, (..., 'YOUTUBE_VIDEO_ID', {str}, any))
            or traverse_obj(webpage, (
                {find_element(cls='movieFrame modal', html=True)}, {extract_attributes}, 'id', {str})))
        if not youtube_id:
            raise ExtractorError('No video found', expected=True)

        return self.url_result(youtube_id, YoutubeIE)


class SteamCommunityBroadcastIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/broadcast/watch/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://steamcommunity.com/broadcast/watch/76561199073851486',
        'info_dict': {
            'id': '76561199073851486',
            'ext': 'mp4',
            'title': str,
            'uploader_id': '1113585758',
            'uploader': 'pepperm!nt',
            'live_status': 'is_live',
        },
        'params': {'skip_download': 'Livestream'},
    }]


Review comment (suggestion):
with `_search_json`, passing a default value implies `fatal=False`
```suggestion
            file_id, default={}, transform_source=js_to_json)
```

Code after:
            'comment_count': int,
            'description': 'md5:1b8a103a5d67a3c48d07c065de7e2c63',
            'duration': 83,
            'like_count': int,
            'live_status': 'not_live',
            'media_type': 'video',
            'playable_in_embed': True,
            'tags': 'count:10',
            'thumbnail': r're:https?://i\.ytimg\.com/vi/.+',
            'timestamp': 1754427291,
            'upload_date': '20250805',
            'uploader': 'Bombass Team',
            'uploader_id': '@BombassTeam',
            'uploader_url': 'https://www.youtube.com/@BombassTeam',
            'view_count': int,
        },
        'add_ie': ['Youtube'],
        'params': {'skip_download': 'm3u8'},
    }]

    def _real_extract(self, url):
        file_id = self._match_id(url)
        webpage = self._download_webpage(url, file_id)

        flashvars = self._search_json(
            r'var\s+rgMovieFlashvars\s*=', webpage, 'flashvars',
            file_id, default={}, transform_source=js_to_json)
        youtube_id = (
            traverse_obj(flashvars, (..., 'YOUTUBE_VIDEO_ID', {str}, any))
            or traverse_obj(webpage, (
                {find_element(cls='movieFrame modal', html=True)}, {extract_attributes}, 'id', {str})))
        if not youtube_id:
            raise ExtractorError('No video found', expected=True)

        return self.url_result(youtube_id, YoutubeIE)


class SteamCommunityBroadcastIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/broadcast/watch/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://steamcommunity.com/broadcast/watch/76561199073851486',
        'info_dict': {
            'id': '76561199073851486',
            'ext': 'mp4',
            'title': str,
            'uploader_id': '1113585758',
            'uploader': 'pepperm!nt',
            'live_status': 'is_live',
        },
        'params': {'skip_download': 'Livestream'},
    }]