Compare commits

..

No commits in common. "0a8b675da904c734c49e7022cc87c389d0ec0b2c" and "8f0d32fa838afd7e8e97735846282114325fb137" have entirely different histories.

View File

@ -481,25 +481,24 @@ class FacebookIE(InfoExtractor):
return
def _extract_from_url(self, url, video_id):
cookies = self._get_cookies(url) # Saving before making first request, as they might get discarded
webpage = self._download_webpage(
url.replace('://m.facebook.com/', '://www.facebook.com/'), video_id)
sjs_data = [self._parse_json(j, video_id, fatal=False) for j in re.findall(
r'data-sjs>({.*?ScheduledServerJS.*?})</script>', webpage)]
if cookies.get('c_user') and cookies.get('xs'): # user passed logged-in cookies or attempted to login:
cookies = self._get_cookies(url)
if all(k in cookies for k in ["c_user", "xs"]):
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('Your account is suspended', expected=True)
raise ExtractorError('Login account is suspended.', expected=True)
if 'send a code to confirm the mobile number you give us' in webpage:
raise ExtractorError('Facebook is requiring mobile number confirmation', expected=True)
raise ExtractorError('Mobile number checkpoint for logged in user.', expected=True)
if 'your account has been locked' in webpage:
raise ExtractorError('Your account has been locked', expected=True)
raise ExtractorError('Account is locked.', expected=True)
if props := get_first(sjs_data, (
'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView',