aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroctotherp <89869439+octotherp@users.noreply.github.com>2021-09-01 16:28:25 +0300
committerGitHub <noreply@github.com>2021-09-01 18:58:25 +0530
commit908b56eaf7872149706dbd7fa071f838d0c786b7 (patch)
treeb9ced29bb239b4c0ebb5600c790e15203d915998
parent1461d7bef244b7fc1a84f82512a330576baf327b (diff)
downloadhypervideo-pre-908b56eaf7872149706dbd7fa071f838d0c786b7.tar.lz
hypervideo-pre-908b56eaf7872149706dbd7fa071f838d0c786b7.tar.xz
hypervideo-pre-908b56eaf7872149706dbd7fa071f838d0c786b7.zip
[XHamster] Extract `uploader_id` (#844)
Authored by: octotherp
-rw-r--r--yt_dlp/extractor/xhamster.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/yt_dlp/extractor/xhamster.py b/yt_dlp/extractor/xhamster.py
index 7e33c420e..9d4ed47d4 100644
--- a/yt_dlp/extractor/xhamster.py
+++ b/yt_dlp/extractor/xhamster.py
@@ -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,