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 <fieldhouse@gmx.net>
This commit is contained in:
Paper 2022-05-20 04:21:38 -04:00 committed by GitHub
parent 2e8e7d6d3a
commit ef49e32c36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ class VidLiiIE(InfoExtractor):
'comment_count': int, 'comment_count': int,
'average_rating': float, 'average_rating': float,
'categories': ['Film & Animation'], 'categories': ['Film & Animation'],
'tags': ['1', '2'], 'tags': list,
}, },
}, { }, {
'url': 'https://www.vidlii.com/embed?v=tJluaH4BJ3v&a=0', 'url': 'https://www.vidlii.com/embed?v=tJluaH4BJ3v&a=0',
@ -84,17 +84,17 @@ class VidLiiIE(InfoExtractor):
r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1', r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1',
webpage) webpage)
try: formats = []
self._request_webpage(sources[1][1], video_id, 'Checking HD URL') if len(sources) > 1:
add_format(sources[1][1]) formats = [sources[1][1]]
except ExtractorError: self._check_formats(formats, video_id)
pass if len(sources) > 0:
formats.append(sources[0][1])
add_format(sources[0][1]) map(add_format, formats)
self._sort_formats(formats) self._sort_formats(formats)
title = self._search_regex( title = self._html_search_regex(
(r'<h1>([^<]+)</h1>', r'<title>([^<]+) - VidLii<'), webpage, (r'<h1>([^<]+)</h1>', r'<title>([^<]+) - VidLii<'), webpage,
'title') 'title')