diff options
| author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-04-21 03:30:54 +0800 | 
|---|---|---|
| committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-04-21 03:30:54 +0800 | 
| commit | 92dcba1e1cc411eecb64792e78ad8f3b125691c8 (patch) | |
| tree | d429256727cdfd5e276ee9190921f7cb3a819258 /youtube_dl/extractor/cspan.py | |
| parent | 2fe1b5bd2add12d70717878704cd3f811af5d22c (diff) | |
[CSpan] Fix test cases CSpan_1 and CSpan_2
Diffstat (limited to 'youtube_dl/extractor/cspan.py')
| -rw-r--r-- | youtube_dl/extractor/cspan.py | 22 | 
1 files changed, 15 insertions, 7 deletions
diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py index 7377ac7b9..6bebcc65c 100644 --- a/youtube_dl/extractor/cspan.py +++ b/youtube_dl/extractor/cspan.py @@ -37,11 +37,14 @@ class CSpanIE(InfoExtractor):          }      }, {          'url': 'http://www.c-span.org/video/?318608-1/gm-ignition-switch-recall', +        'md5': '446562a736c6bf97118e389433ed88d4',          'info_dict': {              'id': '342759', +            'ext': 'mp4',              'title': 'General Motors Ignition Switch Recall', +            'duration': 14848, +            'description': 'md5:70c7c3b8fa63fa60d42772440596034c'          }, -        'playlist_duration_sum': 14855,      }, {          # Video from senate.gov          'url': 'http://www.c-span.org/video/?104517-1/immigration-reforms-needed-protect-skilled-american-workers', @@ -97,9 +100,14 @@ class CSpanIE(InfoExtractor):              'duration': int_or_none(f.get('length', {}).get('#text')),          } for partnum, f in enumerate(files)] -        return { -            '_type': 'playlist', -            'entries': entries, -            'title': title, -            'id': video_id, -        } +        if len(entries) == 1: +            entry = dict(entries[0]) +            entry['id'] = video_id +            return entry +        else: +            return { +                '_type': 'playlist', +                'entries': entries, +                'title': title, +                'id': video_id, +            }  | 
