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

Code before:
        filename = qs['filename'][0]
        video_id = remove_end(filename, '.mp4')

        webpage = self._download_webpage(url, video_id)
        committee = qs['comm'][0]

        stream_num, stream_domain, stream_id, msl3 = self._COMMITTEES[committee]

        urls_alternatives = [f'https://www-senate-gov-media-srs.akamaized.net/hls/live/{stream_id}/{committee}/{filename}/master.m3u8',
                             f'https://www-senate-gov-msl3archive.akamaized.net/{msl3}/{filename}_1/master.m3u8',
                             f'{stream_domain}/i/{filename}_1@{stream_num}/master.m3u8',
                             f'{stream_domain}/i/{filename}.mp4/master.m3u8']
        formats = []
        subtitles = {}
        for video_url in urls_alternatives:
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, video_id, ext='mp4', fatal=False)
            if formats:
                break

        return {
            'id': video_id,
            'title': self._html_extract_title(webpage),
            'formats': formats,
            'subtitles': subtitles,
            'thumbnail': traverse_obj(qs, ('poster', 0, {url_or_none})),
            '_old_archive_ids': [make_archive_id('SenateGov', video_id)],
        }


class SenateGovIE(InfoExtractor):
    _IE_NAME = 'senate.gov'
    _VALID_URL = r'https?:\/\/(?:www\.)?(agriculture|aging|appropriations|armed-services|banking|budget|commerce|energy|epw|finance|foreign|help|intelligence|inaugural|judiciary|rules|sbc|veterans)\.senate\.gov'
    _TESTS = [{
        'url': 'https://www.help.senate.gov/hearings/vaccines-saving-lives-ensuring-confidence-and-protecting-public-health',
        'info_dict': {
            'id': 'help090920',
            'display_id': 'vaccines-saving-lives-ensuring-confidence-and-protecting-public-health',
            'title': 'Vaccines: Saving Lives, Ensuring Confidence, and Protecting Public Health',
            'description': 'The U.S. Senate Committee on Health, Education, Labor & Pensions',
            'ext': 'mp4',
            'age_limit': 0,
            'thumbnail': 'https://www.help.senate.gov/assets/images/sharelogo.jpg',
            '_old_archive_ids': ['senategov help090920'],
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://www.appropriations.senate.gov/hearings/watch?hearingid=B8A25434-5056-A066-6020-1F68CB75F0CD',
        'info_dict': {
            'id': 'appropsA051518',
            'display_id': 'watch?hearingid=B8A25434-5056-A066-6020-1F68CB75F0CD',
            'title': 'Review of the FY2019 Budget Request for the U.S. Army',

Review comment (suggestion):
```suggestion
            '_old_archive_ids': [make_archive_id(SenateGovIE, video_id)],
```

Code after:
        filename = qs['filename'][0]
        video_id = remove_end(filename, '.mp4')

        webpage = self._download_webpage(url, video_id)
        committee = qs['comm'][0]

        stream_num, stream_domain, stream_id, msl3 = self._COMMITTEES[committee]

        urls_alternatives = [f'https://www-senate-gov-media-srs.akamaized.net/hls/live/{stream_id}/{committee}/{filename}/master.m3u8',
                             f'https://www-senate-gov-msl3archive.akamaized.net/{msl3}/{filename}_1/master.m3u8',
                             f'{stream_domain}/i/{filename}_1@{stream_num}/master.m3u8',
                             f'{stream_domain}/i/{filename}.mp4/master.m3u8']
        formats = []
        subtitles = {}
        for video_url in urls_alternatives:
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, video_id, ext='mp4', fatal=False)
            if formats:
                break

        return {
            'id': video_id,
            'title': self._html_extract_title(webpage),
            'formats': formats,
            'subtitles': subtitles,
            'thumbnail': traverse_obj(qs, ('poster', 0, {url_or_none})),
            '_old_archive_ids': [make_archive_id(SenateGovIE, video_id)],
        }


class SenateGovIE(InfoExtractor):
    _IE_NAME = 'senate.gov'
    _SUBDOMAIN_RE = '|'.join(map(re.escape, (
        'agriculture', 'aging', 'appropriations', 'armed-services', 'banking',
        'budget', 'commerce', 'energy', 'epw', 'finance', 'foreign', 'help',
        'intelligence', 'inaugural', 'judiciary', 'rules', 'sbc', 'veterans',
    )))
    _VALID_URL = rf'https?://(?:www\.)?(?:{_SUBDOMAIN_RE})\.senate\.gov'
    _TESTS = [{
        'url': 'https://www.help.senate.gov/hearings/vaccines-saving-lives-ensuring-confidence-and-protecting-public-health',
        'info_dict': {
            'id': 'help090920',
            'display_id': 'vaccines-saving-lives-ensuring-confidence-and-protecting-public-health',
            'title': 'Vaccines: Saving Lives, Ensuring Confidence, and Protecting Public Health',
            'description': 'The U.S. Senate Committee on Health, Education, Labor & Pensions',
            'ext': 'mp4',
            'age_limit': 0,
            'thumbnail': 'https://www.help.senate.gov/assets/images/sharelogo.jpg',
            '_old_archive_ids': ['senategov help090920'],
        },
        'params': {'skip_download': 'm3u8'},
    }, {