From 2606c3108e241e3b3a6019a93372e545b9dd140d Mon Sep 17 00:00:00 2001 From: DarkFighterLuke Date: Sat, 26 Feb 2022 15:50:14 +0100 Subject: [PATCH] Check whether actors_data has been found --- youtube_dl/extractor/xvideos.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index f7820e196..e15b50870 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -154,11 +154,12 @@ class XVideosIE(InfoExtractor): actors_data = re.findall(r'href="(?P/pornstars/.+?)" class="btn btn-default label profile hover-name">(?P.+?)', webpage) actors = [] - for actor_tuple in actors_data: - actors.append({ - 'given_name': actor_tuple[1], - 'url': urljoin(url, actor_tuple[0]), - }) + if actors_data is not None: + 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)