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

move profile_url closer to its usage

This commit is contained in:
sebastian.kondraciuk 2024-05-27 13:29:04 +02:00
parent 0c0a631e99
commit 6d20f7dc69

View File

@ -527,7 +527,6 @@ def extract_metadata(webpage):
or get_first(post, (..., 'video', lambda k, v: k == 'owner' and v['name']))
or get_first(post, ('node', 'actors', ..., {dict}))
or get_first(post, ('event', 'event_creator', {dict})) or {})
profile_url = get_first(post, ('attachments', ..., 'media', 'creation_story', 'comet_sections', 'actor_photo', 'story', 'actors', ..., 'profile_url')) or None
uploader = uploader_data.get('name') or (
clean_html(get_element_by_id('fbPhotoPageAuthorName', webpage))
or self._search_regex(
@ -542,6 +541,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
profile_url = get_first(post, ('attachments', ..., 'media', 'creation_story', 'comet_sections', 'actor_photo', 'story', 'actors', ..., 'profile_url')) or None
follower_count = extract_follower_count(self._download_webpage(profile_url, None))
info_dict = {
'description': description,