1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-07-01 09:50:05 +02:00

remove profile url shenanigans

This commit is contained in:
sebastian.kondraciuk 2024-05-27 13:26:53 +02:00
parent 8f95c7a3b1
commit 0c0a631e99

View File

@ -542,6 +542,7 @@ def extract_metadata(webpage):
# in https://www.facebook.com/yaroslav.korpan/videos/1417995061575415/
if thumbnail and not re.search(r'\.(?:jpg|png)', thumbnail):
thumbnail = None
follower_count = extract_follower_count(self._download_webpage(profile_url, None))
info_dict = {
'description': description,
'uploader': uploader,
@ -553,7 +554,7 @@ def extract_metadata(webpage):
webpage, 'view count', default=None)),
'concurrent_view_count': get_first(post, (
('video', (..., ..., 'attachments', ..., 'media')), 'liveViewerCount', {int_or_none})),
'profile_url': profile_url,
'channel_follower_count': follower_count,
}
info_json_ld = self._search_json_ld(webpage, video_id, default={})
@ -736,11 +737,6 @@ def parse_attachment(attachment, key='media'):
video_info = entries[0] if entries else {'id': video_id}
webpage_info = extract_metadata(webpage)
if profile_url := webpage_info.get('profile_url'):
profile_page = self._download_webpage(profile_url, None)
follower_count = extract_follower_count(profile_page)
webpage_info['channel_follower_count'] = follower_count
del webpage_info['profile_url']
# honor precise duration in video info
if video_info.get('duration'):
webpage_info['duration'] = video_info['duration']