From 5143f916f3cbddbaf97a1d8c8591bd86cc65ea5b Mon Sep 17 00:00:00 2001 From: ringus1 Date: Thu, 1 Feb 2024 08:14:23 +0100 Subject: [PATCH] PR fixes - clear up messages --- yt_dlp/extractor/facebook.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py index f1daa1fd61..b6366e78ce 100644 --- a/yt_dlp/extractor/facebook.py +++ b/yt_dlp/extractor/facebook.py @@ -488,17 +488,17 @@ class FacebookIE(InfoExtractor): r'data-sjs>({.*?ScheduledServerJS.*?})', webpage)] cookies = self._get_cookies(url) - if all(k in cookies for k in ["c_user", "xs"]): + if cookies.get('c_user') and cookies.get('xs'): # user passed logged-in cookies or attempted to login: if get_first(sjs_data, ( 'require', ..., ..., ..., '__bbox', 'define', - lambda _, v: 'CurrentUserInitialData' in v, ..., 'ACCOUNT_ID'), default="0") == "0": + lambda _, v: 'CurrentUserInitialData' in v, ..., 'ACCOUNT_ID'), default='0') == '0': raise ExtractorError('Failed to login with provided data.', expected=True) if any(content in webpage for content in ['180 days left to appeal', 'suspended your account']): - raise ExtractorError('Login account is suspended.', expected=True) + raise ExtractorError('Your account is suspended', expected=True) if 'send a code to confirm the mobile number you give us' in webpage: - raise ExtractorError('Mobile number checkpoint for logged in user.', expected=True) + raise ExtractorError('Facebook is requiring mobile number confirmation', expected=True) if 'your account has been locked' in webpage: - raise ExtractorError('Account is locked.', expected=True) + raise ExtractorError('Your account has been locked', expected=True) if props := get_first(sjs_data, ( 'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView',