1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

Rank flake8

This commit is contained in:
LexManos 2020-01-10 12:24:04 -08:00
parent 8e1b235c0e
commit 58fbc02cc6

View File

@ -140,13 +140,13 @@ class GoIE(AdobePassIE):
# https://abc.com/shows/the-rookie/episode-guide/season-02/03-the-bet
r'\b(?:video)?id["\']\s*:\s*["\'](VDKA\w+)'
), webpage, 'video id', default=[video_id])
# Remove duplicates and nulls
if video_id:
tmp = []
[tmp.append(x) for x in video_id if x and x not in tmp]
video_id = tmp
if not site_info:
brand = self._search_regex(
(r'data-brand=\s*["\']\s*(\d+)',
@ -167,23 +167,23 @@ class GoIE(AdobePassIE):
video['url'], 'Go', video.get('id'), video.get('title')))
entries.reverse()
return self.playlist_result(entries, show_id, show_title)
if not isinstance(video_id, list):
video_id = [video_id]
entries = []
for id in video_id:
entry = self._real_extract_single(id, site_info, brand)
entry = self._real_extract_single(url, id, site_info, brand)
if entry:
entries.append(entry)
if len(entries) == 0:
return None
elif len(entries) == 1:
return entries[0]
return self.playlist_result(entries)
def _real_extract_single(self, video_id, site_info, brand):
def _real_extract_single(self, url, video_id, site_info, brand):
video_data = self._extract_videos(brand, video_id)[0]
video_id = video_data['id']
title = video_data['title']