From 908b56eaf7872149706dbd7fa071f838d0c786b7 Mon Sep 17 00:00:00 2001 From: octotherp <89869439+octotherp@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:28:25 +0300 Subject: [PATCH] [XHamster] Extract `uploader_id` (#844) Authored by: octotherp --- yt_dlp/extractor/xhamster.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yt_dlp/extractor/xhamster.py b/yt_dlp/extractor/xhamster.py index 7e33c420e4..9d4ed47d41 100644 --- a/yt_dlp/extractor/xhamster.py +++ b/yt_dlp/extractor/xhamster.py @@ -245,6 +245,8 @@ def get_height(s): 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 @@ def get_height(s): '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 @@ def get_height(s): 'description': description, 'upload_date': upload_date, 'uploader': uploader, + 'uploader_id': uploader.lower() if uploader else None, 'thumbnail': thumbnail, 'duration': duration, 'view_count': view_count,