Updated _COMM_MAP to be a dictionary to speed up execution. Updated values from latest senate.gov page.

This commit is contained in:
jsmnhou 2023-04-09 16:13:13 -04:00
parent d59b83f04b
commit 7def329f19

View File

@ -16,39 +16,43 @@ from ..compat import (
class SenateISVPIE(InfoExtractor): class SenateISVPIE(InfoExtractor):
_COMM_MAP = [ # committee --> [stream_number, stream_domain, stream_id, msl3]
['ag', '76440', 'http://ag-f.akamaihd.net'], _COMM_MAP = {
['aging', '76442', 'http://aging-f.akamaihd.net'], 'ag': [76440, 'https://ag-f.akamaihd.net', 2036803, 'agriculture'],
['approps', '76441', 'http://approps-f.akamaihd.net'], 'aging': [76442, 'https://aging-f.akamaihd.net', 2036801, 'aging'],
['armed', '76445', 'http://armed-f.akamaihd.net'], 'approps': [76441, 'https://approps-f.akamaihd.net', 2036802, 'appropriations'],
['banking', '76446', 'http://banking-f.akamaihd.net'], 'armed': [76445, 'https://armed-f.akamaihd.net', 2036800, 'armedservices'],
['budget', '76447', 'http://budget-f.akamaihd.net'], 'banking': [76446, 'https://banking-f.akamaihd.net', 2036799, 'banking'],
['cecc', '76486', 'http://srs-f.akamaihd.net'], 'budget': [76447, 'https://budget-f.akamaihd.net', 2036798, 'budget'],
['commerce', '80177', 'http://commerce1-f.akamaihd.net'], 'cecc': [76486, 'https://srs-f.akamaihd.net', 2036782, 'srs_cecc'],
['csce', '75229', 'http://srs-f.akamaihd.net'], 'commerce': [80177, 'https://commerce1-f.akamaihd.net', 2036779, 'commerce'],
['dpc', '76590', 'http://dpc-f.akamaihd.net'], 'csce': [75229, 'https://srs-f.akamaihd.net', 2036777, 'srs_srs'],
['energy', '76448', 'http://energy-f.akamaihd.net'], 'dpc': [76590, 'https://dpc-f.akamaihd.net', None, 'dpc'],
['epw', '76478', 'http://epw-f.akamaihd.net'], 'energy': [76448, 'https://energy-f.akamaihd.net', 2036797, 'energy'],
['ethics', '76449', 'http://ethics-f.akamaihd.net'], 'epw': [76478, 'https://epw-f.akamaihd.net', 2036783, 'environment'],
['finance', '76450', 'http://finance-f.akamaihd.net'], 'ethics': [76449, 'https://ethics-f.akamaihd.net', 2036796, 'ethics'],
['foreign', '76451', 'http://foreign-f.akamaihd.net'], 'finance': [76450, 'https://finance-f.akamaihd.net', 2036795, 'finance_finance'],
['govtaff', '76453', 'http://govtaff-f.akamaihd.net'], 'foreign': [76451, 'https://foreign-f.akamaihd.net', 2036794, 'foreignrelations'],
['help', '76452', 'http://help-f.akamaihd.net'], 'govtaff': [76453, 'https://govtaff-f.akamaihd.net', 2036792, 'hsgac'],
['indian', '76455', 'http://indian-f.akamaihd.net'], 'help': [76452, 'https://help-f.akamaihd.net', 2036793, 'help'],
['intel', '76456', 'http://intel-f.akamaihd.net'], 'indian': [76455, 'https://indian-f.akamaihd.net', 2036791, 'indianaffairs'],
['intlnarc', '76457', 'http://intlnarc-f.akamaihd.net'], 'intel': [76456, 'https://intel-f.akamaihd.net', 2036790, 'intelligence'],
['jccic', '85180', 'http://jccic-f.akamaihd.net'], 'intlnarc': [76457, 'https://intlnarc-f.akamaihd.net', None, 'internationalnarcoticscaucus'],
['jec', '76458', 'http://jec-f.akamaihd.net'], 'jccic': [85180, 'https://jccic-f.akamaihd.net', 2036778, 'jccic'],
['judiciary', '76459', 'http://judiciary-f.akamaihd.net'], 'jec': [76458, 'https://jec-f.akamaihd.net', 2036789, 'jointeconomic'],
['rpc', '76591', 'http://rpc-f.akamaihd.net'], 'judiciary': [76459, 'https://judiciary-f.akamaihd.net', 2036788, 'judiciary'],
['rules', '76460', 'http://rules-f.akamaihd.net'], 'rpc': [76591, 'https://rpc-f.akamaihd.net', None, 'rpc'],
['saa', '76489', 'http://srs-f.akamaihd.net'], 'rules': [76460, 'https://rules-f.akamaihd.net', 2036787, 'rules'],
['smbiz', '76461', 'http://smbiz-f.akamaihd.net'], 'saa': [76489, 'https://srs-f.akamaihd.net', 2036780, 'srs_saa'],
['srs', '75229', 'http://srs-f.akamaihd.net'], 'smbiz': [76461, 'https://smbiz-f.akamaihd.net', 2036786, 'smallbusiness'],
['uscc', '76487', 'http://srs-f.akamaihd.net'], 'srs': [75229, 'https://srs-f.akamaihd.net', 2031966, 'srs_srs'],
['vetaff', '76462', 'http://vetaff-f.akamaihd.net'], 'uscc': [76487, 'https://srs-f.akamaihd.net', 2036781, 'srs_uscc'],
['arch', '', 'http://ussenate-f.akamaihd.net/'] 'vetaff': [76462, 'https://vetaff-f.akamaihd.net', 2036785, 'veteransaffairs'],
] 'arch': [None, 'https://ussenate-f.akamaihd.net/', None, None],
'uscp': [None, '', 2043685, 'uscp'],
'cio': [None, '', 2043686, 'cio'],
}
_IE_NAME = 'senate.gov' _IE_NAME = 'senate.gov'
_VALID_URL = r'https?://(?:www\.)?senate\.gov/isvp/?\?(?P<qs>.+)' _VALID_URL = r'https?://(?:www\.)?senate\.gov/isvp/?\?(?P<qs>.+)'
_TESTS = [{ _TESTS = [{