From ef49e32c36fa4440621ce4598703402386c044c2 Mon Sep 17 00:00:00 2001 From: Paper <37962225+mrpapersonic@users.noreply.github.com> Date: Fri, 20 May 2022 04:21:38 -0400 Subject: [PATCH] Apply suggestions from code review * tags: ['1', '2'] -> list * self._check_formats() used for checking HD url * self._search_regex -> self._html_search_regex Co-authored-by: dirkf --- youtube_dl/extractor/vidlii.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/youtube_dl/extractor/vidlii.py b/youtube_dl/extractor/vidlii.py index 14b821570..ce35be62d 100644 --- a/youtube_dl/extractor/vidlii.py +++ b/youtube_dl/extractor/vidlii.py @@ -55,7 +55,7 @@ class VidLiiIE(InfoExtractor): 'comment_count': int, 'average_rating': float, 'categories': ['Film & Animation'], - 'tags': ['1', '2'], + 'tags': list, }, }, { 'url': 'https://www.vidlii.com/embed?v=tJluaH4BJ3v&a=0', @@ -84,17 +84,17 @@ class VidLiiIE(InfoExtractor): r'src\s*:\s*(["\'])(?P(?:https?://)?(?:(?!\1).)+)\1', webpage) - try: - self._request_webpage(sources[1][1], video_id, 'Checking HD URL') - add_format(sources[1][1]) - except ExtractorError: - pass - - add_format(sources[0][1]) + formats = [] + if len(sources) > 1: + formats = [sources[1][1]] + self._check_formats(formats, video_id) + if len(sources) > 0: + formats.append(sources[0][1]) + map(add_format, formats) self._sort_formats(formats) - title = self._search_regex( + title = self._html_search_regex( (r'

([^<]+)

', r'([^<]+) - VidLii<'), webpage, 'title')