From 109b85c534a70e13f185779534cd1fccc4bc36e9 Mon Sep 17 00:00:00 2001 From: DarkFighterLuke Date: Sat, 26 Feb 2022 16:50:40 +0100 Subject: [PATCH] Fix checks on empty data modified: youtube_dl/extractor/xvideos.py --- youtube_dl/extractor/xvideos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 5102fdffb..410496743 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -151,20 +151,20 @@ class XVideosIE(InfoExtractor): creator_data = re.findall(r'(?P.+?)<', webpage) creator = '' uploader_url = '' - if creator_data is not None: + if creator_data != []: creator = creator_data[0][1] uploader_url = creator_data[0][0] actors_data = re.findall(r'href="(?P/pornstars/.+?)" class="btn btn-default label profile hover-name">(?P.+?)', webpage) actors = [] - if actors_data is not None: + if actors_data != []: for actor_tuple in actors_data: actors.append({ 'given_name': actor_tuple[1], 'url': urljoin(url, actor_tuple[0]), }) - views = self._search_regex(r'(?P.+?)<', webpage, 'views', group='views', default=0) + views = self._search_regex(r'(?P.+?)<', webpage, 'views', group='views', default=None) return { 'id': video_id,