ronantakizawa/codereview-bench huggingface dataset:
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/agalega.py (Python)

Code before:
            'ext': 'mp4',
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        content_data = self._call_api(
            f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
            query={
                'optional_fields': 'image,is_premium,short_description,has_subtitle',
            })
        resource_data = self._call_api(
            f'content_resources/{video_id}/', video_id, note='Downloading resource data',
            query={
                'optional_fields': 'media_url',
            })

        formats = []
        subtitles = {}
        for m3u8_url in traverse_obj(resource_data, ('results', ..., 'media_url', {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                m3u8_url, video_id, ext='mp4', m3u8_id='hls')
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)
        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(content_data, {
                'title': ('name', {str_or_none}),
                'description': (('description', 'short_description'), {str_or_none}, any),
                'thumbnail': ('image', {url_or_none}),
            }),
        }


Review comment (suggestion):
```suggestion
            self._merge_subtitles(subs, target=subtitles)

        return {
```

Code after:
            'ext': 'mp4',
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        content_data = self._call_api(
            f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
            query={
                'optional_fields': 'image,is_premium,short_description,has_subtitle',
            })
        resource_data = self._call_api(
            f'content_resources/{video_id}/', video_id, note='Downloading resource data',
            query={
                'optional_fields': 'media_url',
            })

        formats = []
        subtitles = {}
        for m3u8_url in traverse_obj(resource_data, ('results', ..., 'media_url', {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                m3u8_url, video_id, ext='mp4', m3u8_id='hls')
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        return {
            'id': video_id,
            'formats': formats,
            'subtitles': subtitles,
            **traverse_obj(content_data, {
                'title': ('name', {str}),
                'description': (('description', 'short_description'), {str}, any),
                'thumbnail': ('image', {url_or_none}),
            }),
        }
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/netapp.py (Python)

Code before:
            'ie_key': 'BrightcoveNew',
            'title': title,
            'description': description,
        }


class NetAppCollectionIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
    _TESTS = [{
        'url': 'https://media.netapp.com/collection/9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        'info_dict': {
            'title': 'Featured sessions',
            'id': '9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        },
        'playlist_count': 4,
    }]

    def _entries(self, metadata):
        for item in metadata.get('items', {}):
            video_id = item.get('brightcoveVideoId')
            yield {
                '_type': 'url_transparent',
                'url': self._BC_URL % video_id,
                'ie_key': 'BrightcoveNew',
                'title': item.get('name'),
            }

    def _real_extract(self, url):
        collection_uuid = self._match_id(url)
        metadata = self._download_json(self._COLLECTION_METADATA_URL % collection_uuid, collection_uuid)

        return self.playlist_result(self._entries(metadata), playlist_id=metadata.get('id'), playlist_title=metadata.get('name'))


Review comment (suggestion):
Let's check that the brightcove video ID actually exists
```suggestion
        for item in traverse_obj(metadata, ('items', lambda _, v: v['brightcoveVideoId'])):
            birghtcove_video_id = item['brightcoveVideoId']
            yield self.url_result(
                self._BC_URL_TMPL.format(birghtcove_video_id), BrightcoveNewIE, birghtcove_video_id,
                url_transparent=True, **traverse_obj(item, {
                    'title': ('name', {str}),
                    'description': ('description', {str}),
                    'timestamp': ('createdAt', {parse_iso8601}),
                }))
```

Code after:

class NetAppCollectionIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
    _TESTS = [{
        'url': 'https://media.netapp.com/collection/9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        'info_dict': {
            'title': 'Featured sessions',
            'id': '9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        },
        'playlist_count': 4,
    }]

    def _entries(self, metadata):
        for item in traverse_obj(metadata, ('items', lambda _, v: v['brightcoveVideoId'])):
            brightcove_video_id = item['brightcoveVideoId']
            yield self.url_result(
                self._BC_URL.format(brightcove_video_id), BrightcoveNewIE, brightcove_video_id,
                url_transparent=True, **self._parse_metadata(item))

    def _real_extract(self, url):
        collection_uuid = self._match_id(url)
        metadata = self._download_json(
            f'https://api.media.netapp.com/client/collection/{collection_uuid}', collection_uuid)

        return self.playlist_result(self._entries(metadata), collection_uuid, playlist_title=metadata.get('name'))
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/netapp.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import ExtractorError


class NetAppBaseIE(InfoExtractor):
    _ACCOUNT_ID = '6255154784001'
    _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
    _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s'
    _BC_URL = f'https://players.brightcove.net/{_ACCOUNT_ID}/default_default/index.html?videoId=%s'


class NetAppVideoIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/video-detail/(?P<id>[0-9a-f-]+)'

    _TESTS = [{
        'url': 'https://media.netapp.com/video-detail/da25fc01-82ad-5284-95bc-26920200a222/seamless-storage-for-modern-kubernetes-deployments',
        'info_dict': {
            'id': '1843620950167202073',
            'ext': 'mp4',
            'title': 'Seamless storage for modern Kubernetes deployments',
            'description': 'md5:1ee39e315243fe71fb90af2796037248',
            'uploader_id': '6255154784001',
            'duration': 2159.41,
            'thumbnail': 'https://house-fastly-signed-us-east-1-prod.brightcovecdn.com/image/v1/static/6255154784001/70c1fa03-0e35-4527-bc1f-f1805546bf9a/6c7c327c-408e-4a98-9779-4a0b24708c86/1920x1080/match/image.jpg?fastly_token=NjkxZjNiOGZfYWUwZjc4YWMxZTdhM2I4NzY3MWUxYTVjMmY0OTg4NTQ5ZDkyNDg1YmZmZTg5NjRlNzRkYzIzY2FjZTY5NjlhZl9odHRwczovL2hvdXNlLWZhc3RseS1zaWduZWQtdXMtZWFzdC0xLXByb2QuYnJpZ2h0Y292ZWNkbi5jb20vaW1hZ2UvdjEvc3RhdGljLzYyNTUxNTQ3ODQwMDEvNzBjMWZhMDMtMGUzNS00NTI3LWJjMWYtZjE4MDU1NDZiZjlhLzZjN2MzMjdjLTQwOGUtNGE5OC05Nzc5LTRhMGIyNDcwOGM4Ni8xOTIweDEwODAvbWF0Y2gvaW1hZ2UuanBn',
            'tags': 'count:15',
            'timestamp': 1758213949,
            'upload_date': '20250918',

Review comment (refactor):
```suggestion
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import parse_iso8601
from ..utils.traversal import require, traverse_obj
```

Code after:
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import parse_iso8601
from ..utils.traversal import require, traverse_obj


class NetAppBaseIE(InfoExtractor):
    _BC_URL = 'https://players.brightcove.net/6255154784001/default_default/index.html?videoId={}'

    @staticmethod
    def _parse_metadata(item):
        return traverse_obj(item, {
            'title': ('name', {str}),
            'description': ('description', {str}),
            'timestamp': ('createdAt', {parse_iso8601}),
        })


class NetAppVideoIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/video-detail/(?P<id>[0-9a-f-]+)'

    _TESTS = [{
        'url': 'https://media.netapp.com/video-detail/da25fc01-82ad-5284-95bc-26920200a222/seamless-storage-for-modern-kubernetes-deployments',
        'info_dict': {
            'id': '1843620950167202073',
            'ext': 'mp4',
            'title': 'Seamless storage for modern Kubernetes deployments',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/matchitv.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import unified_strdate


class MatchiTVIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?matchi\.tv/watch\?s=(?P<id>[A-Za-z0-9_-]+)'
    _TESTS = [{
        'url': 'https://matchi.tv/watch?s=pNOyrdC8Bmu',
        'info_dict': {
            'id': 'pNOyrdC8Bmu',
            'ext': 'mp4',
            'title': str,
            'thumbnail': 'https://thumbnails.padelgo.tv/pNOyrdC8Bmu.jpg',
            'upload_date': str,
        },
        'params': {
            'skip_download': True,
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)

        # The stream ID can be generated without needing any further information,
        # however it does not contain any of the video metadata such as title and date.
        m3u8_url = f'https://streams.padelgo.tv/v2/streams/m3u8/{video_id}/anonymous/playlist.m3u8'
        thumbnail = f'https://thumbnails.padelgo.tv/{video_id}.jpg'

        # There is JSON metadata embedded in the webpage that is used for
        # rendering later. Rather than extracting the JSON object and parsing
        # we can just do a simple regex on the webpage to get the key attributes.

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?matchi\.tv/watch\?s=(?P<id>[\w-]+)'
```

Code after:
from .common import InfoExtractor
from ..utils import join_nonempty, unified_strdate
from ..utils.traversal import traverse_obj


class MatchiTVIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?matchi\.tv/watch/?\?(?:[^#]+&)?s=(?P<id>[0-9a-zA-Z]+)'
    _TESTS = [{
        'url': 'https://matchi.tv/watch?s=0euhjzrxsjm',
        'info_dict': {
            'id': '0euhjzrxsjm',
            'ext': 'mp4',
            'title': 'Court 2 at Stratford Padel Club 2024-07-13T18:32:24',
            'thumbnail': 'https://thumbnails.padelgo.tv/0euhjzrxsjm.jpg',
            'upload_date': '20240713',
        },
    }, {
        'url': 'https://matchi.tv/watch?s=FkKDJ9SvAx1',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        loaded_media = traverse_obj(
            self._search_nextjs_data(webpage, video_id, fatal=False),
            ('props', 'pageProps', 'loadedMedia', {dict})) or {}
        start_date_time = traverse_obj(loaded_media, ('startDateTime', {str}))

        return {
            'id': video_id,
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/matchitv.py (Python)

Code before:

class MatchiTVIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?matchi\.tv/watch\?s=(?P<id>[\w-]+)'
    _TESTS = [{
        'url': 'https://matchi.tv/watch?s=0euhjzrxsjm',
        'info_dict': {
            'id': '0euhjzrxsjm',
            'ext': 'mp4',
            'title': 'Court 2 at Stratford Padel Club 2024-07-13T18:32:24',
            'thumbnail': 'https://thumbnails.padelgo.tv/0euhjzrxsjm.jpg',
            'upload_date': '20240713',
        },
    }]

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

        nextjs_data = self._search_nextjs_data(webpage, video_id)
        loaded_media = traverse_obj(nextjs_data, ('props', 'pageProps', 'loadedMedia'), default={})
        court_description = traverse_obj(loaded_media, 'courtDescription')
        start_date_time = traverse_obj(loaded_media, 'startDateTime')

        return {
            'id': video_id,
            'title': join_nonempty(court_description, start_date_time, delim=' '),
            'thumbnail': f'https://thumbnails.padelgo.tv/{video_id}.jpg',
            'upload_date': unified_strdate(start_date_time),
            'formats': self._extract_m3u8_formats(
                f'https://streams.padelgo.tv/v2/streams/m3u8/{video_id}/anonymous/playlist.m3u8',
                video_id, 'mp4', m3u8_id='hls'),
        }


Review comment (suggestion):
```suggestion
            'title': join_nonempty(loaded_media.get('courtDescription'), start_date_time, delim=' '),
```

Code after:


class MatchiTVIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?matchi\.tv/watch/?\?(?:[^#]+&)?s=(?P<id>[0-9a-zA-Z]+)'
    _TESTS = [{
        'url': 'https://matchi.tv/watch?s=0euhjzrxsjm',
        'info_dict': {
            'id': '0euhjzrxsjm',
            'ext': 'mp4',
            'title': 'Court 2 at Stratford Padel Club 2024-07-13T18:32:24',
            'thumbnail': 'https://thumbnails.padelgo.tv/0euhjzrxsjm.jpg',
            'upload_date': '20240713',
        },
    }, {
        'url': 'https://matchi.tv/watch?s=FkKDJ9SvAx1',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        loaded_media = traverse_obj(
            self._search_nextjs_data(webpage, video_id, fatal=False),
            ('props', 'pageProps', 'loadedMedia', {dict})) or {}
        start_date_time = traverse_obj(loaded_media, ('startDateTime', {str}))

        return {
            'id': video_id,
            'title': join_nonempty(loaded_media.get('courtDescription'), start_date_time, delim=' '),
            'thumbnail': f'https://thumbnails.padelgo.tv/{video_id}.jpg',
            'upload_date': unified_strdate(start_date_time),
            'formats': self._extract_m3u8_formats(
                f'https://streams.padelgo.tv/v2/streams/m3u8/{video_id}/anonymous/playlist.m3u8',
                video_id, 'mp4', m3u8_id='hls'),
        }
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/netzkino.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    clean_html,
    int_or_none,
    url_or_none,
    urljoin,
)
from ..utils.traversal import traverse_obj


class NetzkinoIE(InfoExtractor):
    _GEO_COUNTRIES = ['DE']
    _VALID_URL = r'https?://(?:www\.)?netzkino\.de/details/(?P<id>[^/]+)'
    _TESTS = [{
        'url': 'https://www.netzkino.de/details/snow-beast',
        'md5': '1a4c90fe40d3ccabce163287e45e56dd',
        'info_dict': {
            'id': 'snow-beast',
            'ext': 'mp4',
            'title': 'Snow Beast',
            'age_limit': 12,
            'alt_title': 'Snow Beast',
            'cast': 'count:3',
            'categories': 'count:7',
            'creators': 'count:2',
            'description': 'md5:e604a954a7f827a80e96a3a97d48b269',
            'location': 'US',
            'release_year': 2011,
            'thumbnail': r're:https?://.+\.jpg',
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        next_js_data = self._search_nextjs_data(webpage, video_id)

        query = traverse_obj(next_js_data, (

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?netzkino\.de/details/(?P<id>[^/?#]+)'
```

Code after:
from .common import InfoExtractor
from ..utils import (
    clean_html,
    int_or_none,
    url_or_none,
    urljoin,
)
from ..utils.traversal import traverse_obj


class NetzkinoIE(InfoExtractor):
    _GEO_COUNTRIES = ['DE']
    _VALID_URL = r'https?://(?:www\.)?netzkino\.de/details/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.netzkino.de/details/snow-beast',
        'md5': '1a4c90fe40d3ccabce163287e45e56dd',
        'info_dict': {
            'id': 'snow-beast',
            'ext': 'mp4',
            'title': 'Snow Beast',
            'age_limit': 12,
            'alt_title': 'Snow Beast',
            'cast': 'count:3',
            'categories': 'count:7',
            'creators': 'count:2',
            'description': 'md5:e604a954a7f827a80e96a3a97d48b269',
            'location': 'US',
            'release_year': 2011,
            'thumbnail': r're:https?://.+\.jpg',
        },
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        next_js_data = self._search_nextjs_data(webpage, video_id)

        query = traverse_obj(next_js_data, (
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/_extractors.py (Python)

Code before:
    CNNIE,
    CNNIndonesiaIE,
)
from .comedycentral import ComedyCentralIE
from .commonmistakes import (
    BlobIE,
    CommonMistakesIE,
    UnicodeBOMIE,
)
from .commonprotocols import (
    MmsIE,
    RtmpIE,
    ViewSourceIE,
)
from .condenast import CondeNastIE
from .contv import CONtvIE
from .corus import CorusIE
from .coub import CoubIE
from .cozytv import CozyTVIE
from .cpac import (
    CPACIE,
    CPACPlaylistIE,
)
from .cracked import CrackedIE
from .craftsy import CraftsyIE
from .croatian import CroatianIE
from .crooksandliars import CrooksAndLiarsIE
from .crowdbunker import (
    CrowdBunkerChannelIE,
    CrowdBunkerIE,
)
from .crtvg import CrtvgIE
from .cspan import (
    CSpanCongressIE,
    CSpanIE,
)
from .ctsnews import CtsNewsIE
from .ctvnews import CTVNewsIE
from .cultureunplugged import CultureUnpluggedIE
from .curiositystream import (
    CuriosityStreamCollectionsIE,
    CuriosityStreamIE,
    CuriosityStreamSeriesIE,
)
from .cybrary import (
    CybraryCourseIE,
    CybraryIE,
)
from .dacast import (
    DacastPlaylistIE,
    DacastVODIE,

Review comment (suggestion):
The name of the site is "croatian.film"
```suggestion
from .croatianfilm import CroatianFilmIE
```

Code after:
    CNNIE,
    CNNIndonesiaIE,
)
from .comedycentral import ComedyCentralIE
from .commonmistakes import (
    BlobIE,
    CommonMistakesIE,
    UnicodeBOMIE,
)
from .commonprotocols import (
    MmsIE,
    RtmpIE,
    ViewSourceIE,
)
from .condenast import CondeNastIE
from .contv import CONtvIE
from .corus import CorusIE
from .coub import CoubIE
from .cozytv import CozyTVIE
from .cpac import (
    CPACIE,
    CPACPlaylistIE,
)
from .cracked import CrackedIE
from .craftsy import CraftsyIE
from .croatianfilm import CroatianFilmIE
from .crooksandliars import CrooksAndLiarsIE
from .crowdbunker import (
    CrowdBunkerChannelIE,
    CrowdBunkerIE,
)
from .crtvg import CrtvgIE
from .cspan import (
    CSpanCongressIE,
    CSpanIE,
)
from .ctsnews import CtsNewsIE
from .ctvnews import CTVNewsIE
from .cultureunplugged import CultureUnpluggedIE
from .curiositystream import (
    CuriosityStreamCollectionsIE,
    CuriosityStreamIE,
    CuriosityStreamSeriesIE,
)
from .cybrary import (
    CybraryCourseIE,
    CybraryIE,
)
from .dacast import (
    DacastPlaylistIE,
    DacastVODIE,
Repository: yt-dlp/yt-dlp
File: yt_dlp/downloader/__init__.py (Python)

Code before:
from .rtsp import RtspFD
from .websocket import WebSocketFragmentFD
from .youtube_live_chat import YoutubeLiveChatFD
from .bunnycdn import BunnyCdnFD
from .afreecatv import AfreecaTVFD

PROTOCOL_MAP = {
    'rtmp': RtmpFD,
    'rtmpe': RtmpFD,
    'rtmp_ffmpeg': FFmpegFD,
    'm3u8_native': HlsFD,
    'm3u8': FFmpegFD,
    'mms': RtspFD,
    'rtsp': RtspFD,
    'f4m': F4mFD,
    'http_dash_segments': DashSegmentsFD,
    'http_dash_segments_generator': DashSegmentsFD,
    'ism': IsmFD,
    'mhtml': MhtmlFD,
    'niconico_live': NiconicoLiveFD,
    'fc2_live': FC2LiveFD,
    'websocket_frag': WebSocketFragmentFD,
    'youtube_live_chat': YoutubeLiveChatFD,
    'youtube_live_chat_replay': YoutubeLiveChatFD,
    'bunnycdn': BunnyCdnFD,
    'afreecatv': AfreecaTVFD,
}


def shorten_protocol_name(proto, simplify=False):
    short_protocol_names = {
        'm3u8_native': 'm3u8',
        'm3u8': 'm3u8F',
        'rtmp_ffmpeg': 'rtmpF',
        'http_dash_segments': 'dash',
        'http_dash_segments_generator': 'dashG',
        'websocket_frag': 'WSfrag',
    }
    if simplify:
        short_protocol_names.update({
            'https': 'http',
            'ftps': 'ftp',
            'm3u8': 'm3u8',  # Reverse above m3u8 mapping
            'm3u8_native': 'm3u8',
            'http_dash_segments_generator': 'dash',
            'rtmp_ffmpeg': 'rtmp',
            'm3u8_frag_urls': 'm3u8',
            'dash_frag_urls': 'dash',
        })
    return short_protocol_names.get(proto, proto)


Review comment (suggestion):
per suggestion above
```suggestion
    'soopvod': SoopVodFD,
```

Code after:
from .rtsp import RtspFD
from .websocket import WebSocketFragmentFD
from .youtube_live_chat import YoutubeLiveChatFD
from .bunnycdn import BunnyCdnFD
from .soop import SoopVodFD

PROTOCOL_MAP = {
    'rtmp': RtmpFD,
    'rtmpe': RtmpFD,
    'rtmp_ffmpeg': FFmpegFD,
    'm3u8_native': HlsFD,
    'm3u8': FFmpegFD,
    'mms': RtspFD,
    'rtsp': RtspFD,
    'f4m': F4mFD,
    'http_dash_segments': DashSegmentsFD,
    'http_dash_segments_generator': DashSegmentsFD,
    'ism': IsmFD,
    'mhtml': MhtmlFD,
    'niconico_live': NiconicoLiveFD,
    'fc2_live': FC2LiveFD,
    'websocket_frag': WebSocketFragmentFD,
    'youtube_live_chat': YoutubeLiveChatFD,
    'youtube_live_chat_replay': YoutubeLiveChatFD,
    'bunnycdn': BunnyCdnFD,
    'soopvod': SoopVodFD,
}


def shorten_protocol_name(proto, simplify=False):
    short_protocol_names = {
        'm3u8_native': 'm3u8',
        'm3u8': 'm3u8F',
        'rtmp_ffmpeg': 'rtmpF',
        'http_dash_segments': 'dash',
        'http_dash_segments_generator': 'dashG',
        'websocket_frag': 'WSfrag',
    }
    if simplify:
        short_protocol_names.update({
            'https': 'http',
            'ftps': 'ftp',
            'm3u8': 'm3u8',  # Reverse above m3u8 mapping
            'm3u8_native': 'm3u8',
            'http_dash_segments_generator': 'dash',
            'rtmp_ffmpeg': 'rtmp',
            'm3u8_frag_urls': 'm3u8',
            'dash_frag_urls': 'dash',
        })
    return short_protocol_names.get(proto, proto)