mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-02 15:21:23 +02:00
Compare commits
No commits in common. "0a8b675da904c734c49e7022cc87c389d0ec0b2c" and "8f0d32fa838afd7e8e97735846282114325fb137" have entirely different histories.
0a8b675da9
...
8f0d32fa83
|
@ -481,25 +481,24 @@ class FacebookIE(InfoExtractor):
|
||||||
return
|
return
|
||||||
|
|
||||||
def _extract_from_url(self, url, video_id):
|
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(
|
webpage = self._download_webpage(
|
||||||
url.replace('://m.facebook.com/', '://www.facebook.com/'), video_id)
|
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(
|
sjs_data = [self._parse_json(j, video_id, fatal=False) for j in re.findall(
|
||||||
r'data-sjs>({.*?ScheduledServerJS.*?})</script>', webpage)]
|
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, (
|
if get_first(sjs_data, (
|
||||||
'require', ..., ..., ..., '__bbox', 'define',
|
'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)
|
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']):
|
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:
|
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:
|
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, (
|
if props := get_first(sjs_data, (
|
||||||
'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView',
|
'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user