1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-09 16:27:04 +01:00

[livestream] PEP8

This commit is contained in:
Philipp Hagemeister 2014-07-20 23:34:20 +02:00
parent 727d2930f2
commit 72e785f36a

View File

@ -28,11 +28,13 @@ class LivestreamIE(InfoExtractor):
} }
def _extract_video_info(self, video_data): def _extract_video_info(self, video_data):
video_url = video_data.get('progressive_url_hd') or video_data.get('progressive_url') video_url = (
video_data.get('progressive_url_hd') or
video_data.get('progressive_url')
)
return { return {
'id': compat_str(video_data['id']), 'id': compat_str(video_data['id']),
'url': video_url, 'url': video_url,
'ext': 'mp4',
'title': video_data['caption'], 'title': video_data['caption'],
'thumbnail': video_data['thumbnail_url'], 'thumbnail': video_data['thumbnail_url'],
'upload_date': video_data['updated_at'].replace('-', '')[:8], 'upload_date': video_data['updated_at'].replace('-', '')[:8],
@ -50,7 +52,8 @@ class LivestreamIE(InfoExtractor):
r'window.config = ({.*?});', webpage, 'window config') r'window.config = ({.*?});', webpage, 'window config')
info = json.loads(config_json)['event'] info = json.loads(config_json)['event']
videos = [self._extract_video_info(video_data['data']) videos = [self._extract_video_info(video_data['data'])
for video_data in info['feed']['data'] if video_data['type'] == 'video'] for video_data in info['feed']['data']
if video_data['type'] == 'video']
return self.playlist_result(videos, info['id'], info['full_name']) return self.playlist_result(videos, info['id'], info['full_name'])
else: else:
og_video = self._og_search_video_url(webpage, 'player url') og_video = self._og_search_video_url(webpage, 'player url')