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

Code before:
            {find_elements(cls='highlight_player_item highlight_movie', html=True)},
            ..., {extract_attributes}, 'data-props', {json.loads}, {dict},
        )):
            formats = []
            if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})):
                formats.extend(self._extract_m3u8_formats(
                    hls_manifest, app_id, 'mp4', m3u8_id='hls', fatal=False))
            for dash_manifest in traverse_obj(data_prop, ('dashManifests', ..., {url_or_none})):
                formats.extend(self._extract_mpd_formats(
                    dash_manifest, app_id, mpd_id='dash', fatal=False))

            movie_id = traverse_obj(data_prop, ('id', {trim_str(start='highlight_movie_')}))
            entries.append({
                'id': movie_id,
                'title': f'{app_name} video {movie_id}',
                'formats': formats,
                'series': app_name,
                'series_id': app_id,
                'thumbnail': traverse_obj(data_prop, ('screenshot', {url_or_none})),
            })

        return self.playlist_result(entries, app_id, app_name)


class SteamCommunityIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails/?(?:\?(?:[^#]+&)?id=)?(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://steamcommunity.com/sharedfiles/filedetails/2717708756',
        'info_dict': {
            'id': '39Sp2mB1Ly8',
            'ext': 'mp4',
            'title': 'Gmod Stamina System + Customisable HUD',
            'age_limit': 0,
            'availability': 'public',
            'categories': ['Gaming'],
            'channel': 'Zworld Gmod',
            'channel_follower_count': int,
            'channel_id': 'UCER1FWFSdMMiTKBnnEDBPaw',
            'channel_url': 'https://www.youtube.com/channel/UCER1FWFSdMMiTKBnnEDBPaw',
            'chapters': 'count:3',
            'comment_count': int,
            'description': 'md5:0ba8d8e550231211fa03fac920e5b0bf',
            'duration': 162,
            'like_count': int,
            'live_status': 'not_live',
            'media_type': 'video',
            'playable_in_embed': True,
            'tags': 'count:20',
            'thumbnail': r're:https?://i\.ytimg\.com/vi/.+',
            'timestamp': 1641955348,
            'upload_date': '20220112',

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails(?:/?\?(?:[^#]+&)?id=|/)(?P<id>\d+)'
```
or else we could be matching `/filedetails123456`

Code after:
        for data_prop in traverse_obj(webpage, (
            {find_elements(cls='highlight_player_item highlight_movie', html=True)},
            ..., {extract_attributes}, 'data-props', {json.loads}, {dict},
        )):
            formats = []
            if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})):
                formats.extend(self._extract_m3u8_formats(
                    hls_manifest, app_id, 'mp4', m3u8_id='hls', fatal=False))
            for dash_manifest in traverse_obj(data_prop, ('dashManifests', ..., {url_or_none})):
                formats.extend(self._extract_mpd_formats(
                    dash_manifest, app_id, mpd_id='dash', fatal=False))

            movie_id = traverse_obj(data_prop, ('id', {trim_str(start='highlight_movie_')}))
            entries.append({
                'id': movie_id,
                'title': join_nonempty(app_name, 'video', movie_id, delim=' '),
                'formats': formats,
                'series': app_name,
                'series_id': app_id,
                'thumbnail': traverse_obj(data_prop, ('screenshot', {url_or_none})),
            })

        return self.playlist_result(entries, app_id, app_name)


class SteamCommunityIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails(?:/?\?(?:[^#]+&)?id=|/)(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://steamcommunity.com/sharedfiles/filedetails/2717708756',
        'info_dict': {
            'id': '39Sp2mB1Ly8',
            'ext': 'mp4',
            'title': 'Gmod Stamina System + Customisable HUD',
            'age_limit': 0,
            'availability': 'public',
            'categories': ['Gaming'],
            'channel': 'Zworld Gmod',
            'channel_follower_count': int,
            'channel_id': 'UCER1FWFSdMMiTKBnnEDBPaw',
            'channel_url': 'https://www.youtube.com/channel/UCER1FWFSdMMiTKBnnEDBPaw',
            'chapters': 'count:3',
            'comment_count': int,
            'description': 'md5:0ba8d8e550231211fa03fac920e5b0bf',
            'duration': 162,
            'like_count': int,
            'live_status': 'not_live',
            'media_type': 'video',
            'playable_in_embed': True,
            'tags': 'count:20',
            'thumbnail': r're:https?://i\.ytimg\.com/vi/.+',
            'timestamp': 1641955348,