|
@@ -37,6 +37,7 @@ class Session(Session_): |
|
@@ -37,6 +37,7 @@ class Session(Session_): |
|
37
|
content = res.text
|
37
|
content = res.text
|
|
38
|
set_cookie = res.headers.get('Set-Cookie', None)
|
38
|
set_cookie = res.headers.get('Set-Cookie', None)
|
|
39
|
if 'checkpoint' in res.url:
|
39
|
if 'checkpoint' in res.url:
|
|
|
|
40
|
+ # self.get_deal_lock_method(int(kwargs['data']['jazoest']), kwargs['data']['lsd'])
|
|
40
|
raise FBchatUserError('账号被封锁:' + parse_html.checkpoint_text(content))
|
41
|
raise FBchatUserError('账号被封锁:' + parse_html.checkpoint_text(content))
|
|
41
|
elif 'ServerRedirect' in content and self._match_redirect_(content) == '\\/checkpoint\\/block\\/':
|
42
|
elif 'ServerRedirect' in content and self._match_redirect_(content) == '\\/checkpoint\\/block\\/':
|
|
42
|
raise FBchatUserError('账号被封锁')
|
43
|
raise FBchatUserError('账号被封锁')
|
|
@@ -60,6 +61,39 @@ class Session(Session_): |
|
@@ -60,6 +61,39 @@ class Session(Session_): |
|
60
|
hasattr(self, 'logout_call') and self.logout_call()
|
61
|
hasattr(self, 'logout_call') and self.logout_call()
|
|
61
|
raise
|
62
|
raise
|
|
62
|
|
63
|
|
|
|
|
64
|
+ def get_init_lock_args(self, jazoest: str, lsd: str):
|
|
|
|
65
|
+ """
|
|
|
|
66
|
+ 获取解封方式 所需要参数
|
|
|
|
67
|
+ """
|
|
|
|
68
|
+ res = super().request('GET', 'https://www.facebook.com/checkpoint/?next')
|
|
|
|
69
|
+ args = parse_html.get_lock_init(res.text)
|
|
|
|
70
|
+ fb_dtsg_ag = args[0]
|
|
|
|
71
|
+ nh = args[1]
|
|
|
|
72
|
+ params = {
|
|
|
|
73
|
+ 'modules': 'FormSubmit',
|
|
|
|
74
|
+ "dpr": 2,
|
|
|
|
75
|
+ "fb_dtsg_ag": fb_dtsg_ag,
|
|
|
|
76
|
+ "jazoest": jazoest,
|
|
|
|
77
|
+ "nh": nh,
|
|
|
|
78
|
+ "lsd": lsd
|
|
|
|
79
|
+ }
|
|
|
|
80
|
+ return params
|
|
|
|
81
|
+
|
|
|
|
82
|
+ def get_deal_lock_method(self, jazoest, lsd):
|
|
|
|
83
|
+ params = self.get_init_lock_args(jazoest, lsd)
|
|
|
|
84
|
+ res = super().request('GET', 'https://www.facebook.com/ajax/bootloader-endpoint',
|
|
|
|
85
|
+ params=params)
|
|
|
|
86
|
+
|
|
|
|
87
|
+ res = super().request('POST', 'https://www.facebook.com/cookie/consent/',
|
|
|
|
88
|
+ params=params)
|
|
|
|
89
|
+
|
|
|
|
90
|
+ params['submit[Continue]'] = 'Continue'
|
|
|
|
91
|
+ res = super().request('POST',
|
|
|
|
92
|
+ 'https://www.facebook.com/checkpoint/async?next'
|
|
|
|
93
|
+ , data=params
|
|
|
|
94
|
+ )
|
|
|
|
95
|
+ pass
|
|
|
|
96
|
+
|
|
63
|
|
97
|
|
|
64
|
class PCState(State):
|
98
|
class PCState(State):
|
|
65
|
|
99
|
|
|
@@ -128,7 +162,6 @@ class PCState(State): |
|
@@ -128,7 +162,6 @@ class PCState(State): |
|
128
|
'lgnjs': int(time.time()),
|
162
|
'lgnjs': int(time.time()),
|
|
129
|
'timezone': '-480'
|
163
|
'timezone': '-480'
|
|
130
|
})
|
164
|
})
|
|
131
|
-
|
|
|
|
132
|
r = session.post('https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110',
|
165
|
r = session.post('https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110',
|
|
133
|
data=data)
|
166
|
data=data)
|
|
134
|
setCookie = r.headers.get('Set-Cookie') or ''
|
167
|
setCookie = r.headers.get('Set-Cookie') or ''
|