From fcff2c5cd018c0ad3f0fd9736ce2cc477da80709 Mon Sep 17 00:00:00 2001 From: ringus1 Date: Wed, 10 Jan 2024 16:11:45 +0100 Subject: [PATCH] Adding potential fix --- yt_dlp/extractor/facebook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py index a07a0d344..87869fcfc 100644 --- a/yt_dlp/extractor/facebook.py +++ b/yt_dlp/extractor/facebook.py @@ -395,6 +395,7 @@ def _perform_login(self, username, password): try: login_results = self._download_webpage(request, None, note='Logging in', errnote='unable to fetch login page') + # TODO: Request couldn't be processed is returned always if re.search(r'', login_results) is not None: error = self._html_search_regex( r'(?s)]+class=(["\']).*?login_error_box.*?\1[^>]*>]*>.*?]*>(?P.+?)', @@ -465,6 +466,7 @@ def extract_metadata(webpage): description = get_first(media, ('creation_story', 'comet_sections', 'message', 'story', 'message', 'text')) uploader_data = ( get_first(media, ('owner', {dict})) + or get_first(post, ('video', 'creation_story', 'attachments', ..., 'media', lambda k, v: k == 'owner' and v['name'])) or get_first(post, (..., 'video', lambda k, v: k == 'owner' and v['name'])) or get_first(post, ('node', 'actors', ..., {dict})) or {}) @@ -555,7 +557,7 @@ def extract_relay_data(_filter): def extract_relay_prefetched_data(_filter): return traverse_obj(extract_relay_data(_filter), ( 'require', (None, (..., ..., ..., '__bbox', 'require')), - lambda _, v: 'RelayPrefetchedStreamCache' in v, ..., ..., + lambda _, v: any(key.startswith('RelayPrefetchedStreamCache') for key in v if isinstance(key, str)), ..., ..., '__bbox', 'result', 'data', {dict}), get_all=False) or {} if not video_data: