Add default fallback values

This commit is contained in:
DarkFighterLuke 2022-02-26 15:45:23 +01:00
parent fd7aaa6ae9
commit 48e5ff4bb1

View File

@ -146,7 +146,7 @@ class XVideosIE(InfoExtractor):
self._sort_formats(formats) self._sort_formats(formats)
tags = self._search_regex(r'<meta name="keywords" content="xvideos,xvideos\.com, x videos,x video,porn,video,videos,(?P<tag>.+?)"', webpage, 'tags', group='tag').split(',') tags = self._search_regex(r'<meta name="keywords" content="xvideos,xvideos\.com, x videos,x video,porn,video,videos,(?P<tag>.+?)"', webpage, 'tags', group='tag', default='').split(',')
creator_data = re.findall(r'<a href="(?P<creator_url>.+?)" class="btn btn-default label main uploader-tag hover-name"><span class="name">(?P<creator>.+?)<', webpage) creator_data = re.findall(r'<a href="(?P<creator_url>.+?)" class="btn btn-default label main uploader-tag hover-name"><span class="name">(?P<creator>.+?)<', webpage)
creator = creator_data[0][1] creator = creator_data[0][1]
@ -160,7 +160,7 @@ class XVideosIE(InfoExtractor):
'url': urljoin(url, actor_tuple[0]), 'url': urljoin(url, actor_tuple[0]),
}) })
views = self._search_regex(r'<strong class="mobile-hide">(?P<views>.+?)<', webpage, 'views', group='views') views = self._search_regex(r'<strong class="mobile-hide">(?P<views>.+?)<', webpage, 'views', group='views', default=0)
return { return {
'id': video_id, 'id': video_id,