[baidu] Use list comprehension
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 2 Jan 2016 13:46:40 +0000 (21:46 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 2 Jan 2016 13:46:40 +0000 (21:46 +0800)
youtube_dl/extractor/baidu.py

index d35116a7cb412c236977ff84829966b996faf57f..76b21e5962eae26e6bceef265c56e1f1a16ca922 100644 (file)
@@ -48,10 +48,9 @@ class BaiduVideoIE(InfoExtractor):
         episodes_detail = self._call_api(
             'xqsingle', category, playlist_id, 'Download episodes JSON metadata')
 
-        entries = []
-        for episode in episodes_detail['videos']:
-            entries.append(self.url_result(
-                episode['url'], video_title=episode['title']))
+        entries = [self.url_result(
+            episode['url'], video_title=episode['title']
+        ) for episode in episodes_detail['videos']]
 
         return self.playlist_result(
             entries, playlist_id, playlist_title, playlist_description)