aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/xhamster.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/xhamster.py')
-rw-r--r--hypervideo_dl/extractor/xhamster.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/hypervideo_dl/extractor/xhamster.py b/hypervideo_dl/extractor/xhamster.py
index f73b977..9d4ed47 100644
--- a/hypervideo_dl/extractor/xhamster.py
+++ b/hypervideo_dl/extractor/xhamster.py
@@ -120,7 +120,7 @@ class XHamsterIE(InfoExtractor):
}]
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
+ mobj = self._match_valid_url(url)
video_id = mobj.group('id') or mobj.group('id_2')
display_id = mobj.group('display_id') or mobj.group('display_id_2')
@@ -231,7 +231,7 @@ class XHamsterIE(InfoExtractor):
'Referer': standard_url,
},
})
- self._sort_formats(formats, field_preference=('height', 'width', 'tbr', 'format_id'))
+ self._sort_formats(formats)
categories_list = video.get('categories')
if isinstance(categories_list, list):
@@ -245,6 +245,8 @@ class XHamsterIE(InfoExtractor):
else:
categories = None
+ uploader_url = url_or_none(try_get(video, lambda x: x['author']['pageURL']))
+
return {
'id': video_id,
'display_id': display_id,
@@ -253,6 +255,8 @@ class XHamsterIE(InfoExtractor):
'timestamp': int_or_none(video.get('created')),
'uploader': try_get(
video, lambda x: x['author']['name'], compat_str),
+ 'uploader_url': uploader_url,
+ 'uploader_id': uploader_url.split('/')[-1] if uploader_url else None,
'thumbnail': video.get('thumbURL'),
'duration': int_or_none(video.get('duration')),
'view_count': int_or_none(video.get('views')),
@@ -352,6 +356,7 @@ class XHamsterIE(InfoExtractor):
'description': description,
'upload_date': upload_date,
'uploader': uploader,
+ 'uploader_id': uploader.lower() if uploader else None,
'thumbnail': thumbnail,
'duration': duration,
'view_count': view_count,