[kanal2]: avoid shadowing variables from outer scope

This commit is contained in:
Elan Ruusamäe 2018-12-18 11:23:31 +02:00
parent 9bd56961b5
commit 9ee6cd55b2

View File

@ -42,7 +42,7 @@ class Kanal2IE(InfoExtractor):
}, },
] ]
def _real_extract(self, url): def _real_extract(self, url_):
def get_title(info): def get_title(info):
title = info['title'] title = info['title']
@ -101,19 +101,22 @@ class Kanal2IE(InfoExtractor):
return session return session
video_id = self._match_id(url) def extract_info(url):
playlist = get_playlist(video_id) video_id = self._match_id(url)
playlist = get_playlist(video_id)
# return a dict, description from here: # return a dict, description from here:
# https://github.com/rg3/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303 # https://github.com/rg3/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303
info = { info = {
'id': video_id, 'id': video_id,
'title': get_title(playlist['info']), 'title': get_title(playlist['info']),
'description': playlist['info'].get('description'), 'description': playlist['info'].get('description'),
'webpage_url': playlist['data'].get('url'), 'webpage_url': playlist['data'].get('url'),
'thumbnail': playlist['data'].get('image'), 'thumbnail': playlist['data'].get('image'),
'formats': get_formats(playlist, video_id), 'formats': get_formats(playlist, video_id),
'timestamp': get_timestamp(playlist['info']['subtitle']), 'timestamp': get_timestamp(playlist['info']['subtitle']),
} }
return info return info
return extract_info(url_)