X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsenateisvp.py;h=9c53704ea383b1af34e8f8157e327b71c2c3865a;hb=1ddb9456c4a63a207ec40bd74cdf0b36d8c68409;hp=23e1cd944aa717ec2306f3b1b6022f8582c081af;hpb=2fe1b5bd2add12d70717878704cd3f811af5d22c;p=youtube-dl diff --git a/youtube_dl/extractor/senateisvp.py b/youtube_dl/extractor/senateisvp.py index 23e1cd944..9c53704ea 100644 --- a/youtube_dl/extractor/senateisvp.py +++ b/youtube_dl/extractor/senateisvp.py @@ -48,10 +48,9 @@ class SenateISVPIE(InfoExtractor): ["arch", "", "http://ussenate-f.akamaihd.net/"] ] _IE_NAME = 'senate.gov' - _VALID_URL = r'http://www\.senate\.gov/isvp/\?(?P.+)' + _VALID_URL = r'http://www\.senate\.gov/isvp/?\?(?P.+)' _TESTS = [{ 'url': 'http://www.senate.gov/isvp/?comm=judiciary&type=live&stt=&filename=judiciary031715&auto_play=false&wmode=transparent&poster=http%3A%2F%2Fwww.judiciary.senate.gov%2Fthemes%2Fjudiciary%2Fimages%2Fvideo-poster-flash-fit.png', - 'md5': '7314c4b96dad66dd8e63dc3518ceaa6f', 'info_dict': { 'id': 'judiciary031715', 'ext': 'flv', @@ -60,7 +59,6 @@ class SenateISVPIE(InfoExtractor): } }, { 'url': 'http://www.senate.gov/isvp/?type=live&comm=commerce&filename=commerce011514.mp4&auto_play=false', - 'md5': '2917c827513700aa9b70eaebf25116da', 'info_dict': { 'id': 'commerce011514', 'ext': 'flv', @@ -74,12 +72,16 @@ class SenateISVPIE(InfoExtractor): 'ext': 'mp4', 'title': 'Integrated Senate Video Player' } + }, { + # From http://www.c-span.org/video/?96791-1 + 'url': 'http://www.senate.gov/isvp?type=live&comm=banking&filename=banking012715', + 'only_matching': True, }] @staticmethod def _search_iframe_url(webpage): mobj = re.search( - r"]+src=['\"](?Phttp://www\.senate\.gov/isvp/\?[^'\"]+)['\"]", + r"]+src=['\"](?Phttp://www\.senate\.gov/isvp/?\?[^'\"]+)['\"]", webpage) if mobj: return mobj.group('url') @@ -105,8 +107,7 @@ class SenateISVPIE(InfoExtractor): else: title = self._html_search_regex(r'([^<]+)', webpage, video_id) poster = qs.get('poster') - if poster: - thumbnail = poster[0] + thumbnail = poster[0] if poster else None video_type = qs['type'][0] committee = video_type if video_type == 'arch' else qs['comm'][0] @@ -136,15 +137,9 @@ class SenateISVPIE(InfoExtractor): self._sort_formats(formats) - info_dict = { + return { 'id': video_id, 'title': title, + 'formats': formats, 'thumbnail': thumbnail, } - - if len(formats) >= 1: - info_dict.update({'formats': formats}) - else: - info_dict.update(formats[0]) - - return info_dict