diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-11-21 16:08:54 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-11-21 16:08:54 +0800 |
commit | 28602e747c13a7979aedd517e491bada3856cb12 (patch) | |
tree | 07d10c6a581d72919c69ccf12d333ca284d7a7f9 /youtube_dl/extractor | |
parent | 6cc37c69e25f886c466d4b89f0734639e20e279b (diff) | |
download | youtube-dl-28602e747c13a7979aedd517e491bada3856cb12.tar.xz |
[generic] Refactor
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/generic.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 6cffde20d..1991a8684 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -1886,25 +1886,22 @@ class GenericIE(InfoExtractor): # here's a fun little line of code for you: video_id = os.path.splitext(video_id)[0] + entry_info_dict = { + 'id': video_id, + 'uploader': video_uploader, + 'title': video_title, + 'age_limit': age_limit, + } + ext = determine_ext(video_url) if ext == 'smil': - entries.append({ - 'id': video_id, - 'formats': self._extract_smil_formats(video_url, video_id), - 'uploader': video_uploader, - 'title': video_title, - 'age_limit': age_limit, - }) + entry_info_dict['formats'] = self._extract_smil_formats(video_url, video_id) elif ext == 'xspf': return self.playlist_result(self._extract_xspf_playlist(video_url, video_id), video_id) else: - entries.append({ - 'id': video_id, - 'url': video_url, - 'uploader': video_uploader, - 'title': video_title, - 'age_limit': age_limit, - }) + entry_info_dict['url'] = video_url + + entries.append(entry_info_dict) if len(entries) == 1: return entries[0] |