odaislib 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: odaislib
3
+ Version: 1.0.2
4
+ Summary: Facebook Authentication Library with multiple login methods
5
+ Home-page:
6
+ Author: Odai
7
+ Author-email: odaiobeidat00@gmail.com
8
+ Keywords: facebook,login,authentication,api,social
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: requests>=2.25.1
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: keywords
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
27
+
28
+ # Facebook Login Library
29
+ مكتبة بايثون لتسجيل الدخول إلى Facebook بعدة طرق.
@@ -0,0 +1,2 @@
1
+ # Facebook Login Library
2
+ مكتبة بايثون لتسجيل الدخول إلى Facebook بعدة طرق.
@@ -0,0 +1,327 @@
1
+ #The Script And The Library For Odai - @K33Kz -- @K33Ka
2
+ #السكربت و المكتبة لعدي @K33Kz - @K33Ka
3
+ import requests,re,json,time;from uuid import uuid4
4
+ class basic:
5
+ def login(self, email, password, proxies=None):
6
+ r = requests.get("https://www.facebook.com/?_rd")
7
+ m = re.search(r'privacy_mutation_token\s*["\']?\s*[:=]\s*["\']?([A-Za-z0-9_\-:.]+)', r.text)
8
+ token = m.group(1) if m else None
9
+ cok = r.cookies
10
+ fr = cok.get('fr', '')
11
+ cookies = {
12
+ 'datr': '1uBDaYSNCnmSWNXK148RNXci',
13
+ 'sb': '1uBDaSJj0uSvPcQFj-09YEP-',
14
+ 'ps_l': '1',
15
+ 'ps_n': '1',
16
+ 'dpr': '2.8035895824432373',
17
+ 'm_pixel_ratio': '2.549999952316284',
18
+ 'fr': fr,
19
+ 'wd': '891x815',
20
+ }
21
+ headers = {
22
+ 'authority': 'www.facebook.com',
23
+ 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
24
+ 'accept-language': 'ar-AE,ar;q=0.9,en-US;q=0.8,en;q=0.7',
25
+ 'cache-control': 'max-age=0',
26
+ 'content-type': 'application/x-www-form-urlencoded',
27
+ 'dpr': '2.549999952316284',
28
+ 'origin': 'https://www.facebook.com',
29
+ 'referer': 'https://www.facebook.com/?_rdr',
30
+ 'sec-ch-prefers-color-scheme': 'dark',
31
+ 'sec-ch-ua': '"Chromium";v="139", "Not;A=Brand";v="99"',
32
+ 'sec-ch-ua-full-version-list': '"Chromium";v="139.0.7339.0", "Not;A=Brand";v="99.0.0.0"',
33
+ 'sec-ch-ua-mobile': '?0',
34
+ 'sec-ch-ua-model': '""',
35
+ 'sec-ch-ua-platform': '"Linux"',
36
+ 'sec-ch-ua-platform-version': '""',
37
+ 'sec-fetch-dest': 'document',
38
+ 'sec-fetch-mode': 'navigate',
39
+ 'sec-fetch-site': 'same-origin',
40
+ 'sec-fetch-user': '?1',
41
+ 'upgrade-insecure-requests': '1',
42
+ 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36',
43
+ 'viewport-width': '980',
44
+ }
45
+ data = {
46
+ 'jazoest': '21013',
47
+ 'lsd': 'AdGmEblaQpg',
48
+ 'email': email,
49
+ 'login_source': 'comet_headerless_login',
50
+ 'next': '',
51
+ 'encpass': f'PWD_BROWSER:0:{int(time.time())}:{password}',
52
+ }
53
+ response = requests.post(f'https://www.facebook.com/login/?privacy_mutation_token={token}&next',cookies=cookies,headers=headers,data=data,proxies=proxies).text
54
+ account_id = re.search(r'ACCOUNT_ID["\']?\s*[:=]\s*["\']?(\d+)', response)
55
+ user_id = re.search(r'USER_ID["\']?\s*[:=]\s*["\']?(\d+)', response)
56
+ username = re.search(r'USERNAME["\']?\s*[:=]\s*["\']?([a-zA-Z0-9_.]+)', response)
57
+ if (account_id and account_id.group(1) != "0" and
58
+ user_id and user_id.group(1) != "0" and
59
+ username and username.group(1) != "0"):
60
+ return json.dumps({
61
+ "status": "success",
62
+ "account_id": account_id.group(1),
63
+ "username": username.group(1),
64
+ "email": email,
65
+ "password": password,
66
+ "by": "Odai - @K33Kz - @K33Ka"
67
+ })
68
+ elif ('Please complete the security check to log in.' in response or 'two_step_verification' in response or '2fa' in response or '2FA' in response):
69
+ return json.dumps({
70
+ "status": "checkpoint",
71
+ "account_id": account_id.group(1),
72
+ "username": username.group(1),
73
+ "email": email,
74
+ "password": password,
75
+ "by": "Odai - @K33Kz - @K33Ka"
76
+ })
77
+ elif ('كلمة السر التي أدخلتها غير صحيحة.' in response or
78
+ 'هل نسيت كلمة السر؟' in response):
79
+ return json.dumps({
80
+ "status": "bad_password",
81
+ "email": email,
82
+ "password": password,
83
+ "by": "Odai - @K33Kz - @K33Ka"
84
+ })
85
+
86
+ elif 'البريد الإلكتروني أو رقم الهاتف المحمول الذي أدخلته غير مرتبط بحساب.' in response:
87
+ return json.dumps({
88
+ "status": "user_not_found",
89
+ "email": email,
90
+ "password": password,
91
+ "by": "Odai - @K33Kz - @K33Ka"
92
+ })
93
+
94
+ else:
95
+ return json.dumps({
96
+ "status": "unknown_response",
97
+ "email": email,
98
+ "password": password,
99
+ "by": "Odai - @K33Kz - @K33Ka"
100
+ })
101
+ class auth:
102
+ def login(self, email, password,proxies=None):
103
+ data = {
104
+ "locale": "en_GB",
105
+ "format": "json",
106
+ "email": email,
107
+ "password": password,
108
+ "access_token": "200424423651082|2a9918c6bcd75b94cefcbb5635c6ad16",
109
+ "generate_session_cookies": 1
110
+ }
111
+ headers = {
112
+ 'user-agent': 'Mozilla/5.0',
113
+ 'Host': 'graph.facebook.com',
114
+ 'Content-Type': 'application/json;charset=utf-8'
115
+ }
116
+ response = requests.post("https://b-graph.facebook.com/auth/login",data=data,headers=headers,proxies=proxies)
117
+ result = response.json()
118
+ text = response.text
119
+ if 'access_token' in result or 'session_key' in result:
120
+ uid = result.get('uid', '')
121
+ cookies = ';'.join(i['name'] + '=' + i['value'] for i in result.get('session_cookies', []))
122
+ return {
123
+ "status": "success",
124
+ "uid": uid,
125
+ "cookies": cookies,
126
+ "email": email,
127
+ "password": password,
128
+ "by": "Odai - @K33Kz - @K33Ka"
129
+ }
130
+ elif ('www.facebook.com' in result.get('error', {}).get('message', '') or 'Please complete the security check to log in.' in text or 'two_step_verification' in text):
131
+ return {
132
+ "status": "checkpoint",
133
+ "email": email,
134
+ "password": password,
135
+ "by": "Odai - @K33Kz - @K33Ka"
136
+ }
137
+ else:
138
+ return {
139
+ "status": "bad_login",
140
+ "email": email,
141
+ "password": password,
142
+ "by": "Odai - @K33Kz - @K33Ka"
143
+ }
144
+ class mobile:
145
+ def login(self, email, password, proxies=None):
146
+ payload = {
147
+ 'method': "post",
148
+ 'pretty': "false",
149
+ 'format': "json",
150
+ 'server_timestamps': "true",
151
+ 'locale': "en_EN",
152
+ 'purpose': "fetch",
153
+ 'fb_api_req_friendly_name': "FbBloksActionRootQuery-com.bloks.www.bloks.caa.login.async.send_login_request",
154
+ 'fb_api_caller_class': "graphservice",
155
+ 'client_doc_id': "11994080425074657009809260413",
156
+ 'fb_api_client_context': json.dumps({"is_background": False}),
157
+ 'variables': json.dumps({
158
+ "params": {
159
+ "params": json.dumps({
160
+ "params": json.dumps({
161
+ "client_input_params": {
162
+ "sim_phones": [],
163
+ "aymh_accounts": [{
164
+ "profiles": {
165
+ "id": {
166
+ "is_derived": 0,
167
+ "credentials": [],
168
+ "account_center_id": "",
169
+ "profile_picture_url": "",
170
+ "small_profile_picture_url": None,
171
+ "notification_count": 0,
172
+ "token": "",
173
+ "last_access_time": 0,
174
+ "has_smartlock": 0,
175
+ "credential_type": "none",
176
+ "password": "",
177
+ "from_accurate_privacy_result": 0,
178
+ "dbln_validated": 0,
179
+ "user_id": "",
180
+ "name": "",
181
+ "nta_eligibility_reason": None,
182
+ "username": "",
183
+ "account_source": ""
184
+ }
185
+ },
186
+ "id": ""
187
+ }],
188
+ "secure_family_device_id": str(uuid4()),
189
+ "attestation_result": {
190
+ },
191
+ "has_granted_read_contacts_permissions": 0,
192
+ "auth_secure_device_id": "null",
193
+ "has_whatsapp_installed": 1,
194
+ "password": f"#PWD_FB4A:0:{str(int(time.time()))}:{password}",
195
+ "sso_token_map_json_string": "",
196
+ "block_store_machine_id": None,
197
+ "cloud_trust_token": None,
198
+ "event_flow": "login_manual",
199
+ "password_contains_non_ascii": "false",
200
+ "sim_serials": [],
201
+ "client_known_key_hash": "",
202
+ "encrypted_msisdn": "",
203
+ "has_granted_read_phone_permissions": 0,
204
+ "app_manager_id": str(uuid4()),
205
+ "should_show_nested_nta_from_aymh": 1,
206
+ "device_id": str(uuid4()),
207
+ "zero_balance_state": "data",
208
+ "login_attempt_count": 1,
209
+ "flash_call_permission_status": {
210
+ "READ_PHONE_STATE": "DENIED",
211
+ "READ_CALL_LOG": "DENIED",
212
+ "ANSWER_PHONE_CALLS": "DENIED"
213
+ },
214
+ "accounts_list": [],
215
+ "family_device_id": str(uuid4()),
216
+ "fb_ig_device_id": [],
217
+ "device_emails": [],
218
+ "try_num": 3,
219
+ "lois_settings": {
220
+ "lois_token": ""
221
+ },
222
+ "event_step": "home_page",
223
+ "headers_infra_flow_id": str(uuid4()),
224
+ "openid_tokens": {},
225
+ "contact_point": email
226
+ },
227
+ "server_params": {
228
+ "should_trigger_override_login_2fa_action": 0,
229
+ "is_vanilla_password_page_empty_password": 0,
230
+ "is_from_logged_out": 0,
231
+ "should_trigger_override_login_success_action": 0,
232
+ "login_credential_type": "none",
233
+ "server_login_source": "login",
234
+ "waterfall_id": str(uuid4()),
235
+ "two_step_login_type": "one_step_login",
236
+ "login_source": "Login",
237
+ "is_platform_login": 0,
238
+ "pw_encryption_try_count": 1,
239
+ "INTERNAL__latency_qpl_marker_id": 36707139,
240
+ "is_from_aymh": 0,
241
+ "offline_experiment_group": None,
242
+ "is_from_landing_page": 0,
243
+ "password_text_input_id": None,
244
+ "is_from_empty_password": 0,
245
+ "is_from_msplit_fallback": 0,
246
+ "ar_event_source": "login_home_page",
247
+ "username_text_input_id": None,
248
+ "layered_homepage_experiment_group": None,
249
+ "device_id": str(uuid4()),
250
+ "INTERNAL__latency_qpl_instance_id": 1.06996309100672e14,
251
+ "reg_flow_source": "login_home_native_integration_point",
252
+ "is_caa_perf_enabled": 1,
253
+ "credential_type": "password",
254
+ "is_from_password_entry_page": 0,
255
+ "caller": "gslr",
256
+ "family_device_id": str(uuid4()),
257
+ "is_from_assistive_id": 0,
258
+ "access_flow_version": "pre_mt_behavior",
259
+ "is_from_logged_in_switcher": 0
260
+ }
261
+ })
262
+ }),
263
+ "bloks_versioning_id": "c42a4bd8f99cb2bd57ea74ca2b690710be5a50faa60a68bb9bcc524fe6c63e7a",
264
+ "app_id": "com.bloks.www.bloks.caa.login.async.send_login_request"
265
+ },
266
+ "scale": "3",
267
+ "nt_context": {
268
+ "using_white_navbar": True,
269
+ "styles_id": "3b115a54b620c39392b96bdca4c5237f",
270
+ "pixel_ratio": 3,
271
+ "is_push_on": True,
272
+ "debug_tooling_metadata_token": None,
273
+ "is_flipper_enabled": False,
274
+ "theme_params": [{
275
+ "value": [],
276
+ "design_system_name": "FDS"
277
+ }],
278
+ "bloks_version": "c42a4bd8f99cb2bd57ea74ca2b690710be5a50faa60a68bb9bcc524fe6c63e7a"
279
+ }
280
+ }),
281
+ 'fb_api_analytics_tags': json.dumps(["GraphServices"]),
282
+ 'client_trace_id': "a5bba4f8-b87f-4b73-8d9a-44226255a84c"
283
+ }
284
+ headers = {
285
+ 'User-Agent': "[FBAN/FB4A;FBAV/536.0.0.46.77;FBBV/810163229;FBDM/{density=2.75,width=1080,height=2220};FBLC/en_EN;FBRV/0;FBCR/Yemen Mobile;FBMF/Xiaomi;FBBD/Redmi;FBPN/com.facebook.katana;FBDV/Redmi Note 10 Pro;FBSV/11;FBOP/1;FBCA/arm64-v8a:;]",
286
+ 'x-fb-friendly-name': "FbBloksActionRootQuery-com.bloks.www.bloks.caa.login.async.send_login_request",
287
+ 'authorization': "OAuth 350685531728|62f8ce9f74b12f84c123cc23437a4a32",
288
+ }
289
+ response = requests.post("https://graph-fallback.facebook.com/graphql",data=payload,headers=headers,proxies=proxies)
290
+ response_text = response.text
291
+ if re.search(r'"access_token":"(.*?)"', response_text.replace("/", "").replace("\\", "")):
292
+ token_match = re.search(r'"access_token":"(.*?)"', response_text.replace("/", "").replace("\\", ""))
293
+ return {
294
+ "status": "success",
295
+ "access_token": token_match.group(1),
296
+ "email": email,
297
+ "password": password,
298
+ "by": "Odai - @K33Kz - @K33Ka"
299
+ }
300
+ if "Invalid username or password" in response_text or 'override_login_2fa_action' in response_text.lower():
301
+ return {
302
+ "status": "bad_credentials",
303
+ "email": email,
304
+ "password": password,
305
+ "by": "Odai - @K33Kz - @K33Ka"
306
+ }
307
+ else:
308
+ return {
309
+ "status": "unknown_response",
310
+ "email": email,
311
+ "password": password,
312
+ "by": "Odai - @K33Kz - @K33Ka"
313
+
314
+ }
315
+ class apps:
316
+ def get_linked_apps(self, cookies):
317
+ headers = {
318
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
319
+ "Host": "m.facebook.com",
320
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
321
+ }
322
+ cookie_str = f"datr={cookies.get('datr', '')}; fr={cookies.get('fr', '')}; sb=3lMpYKwYO6_QcWBti1wPKbjK; m_pixel_ratio=1; wd=1284x422; c_user={cookies.get('c_user', '')}; xs={cookies.get('xs', '')}"
323
+ headers["Cookie"] = cookie_str
324
+ response = requests.get("https://www.facebook.com/settings?tab=applications&ref=settings",headers=headers)
325
+ apps_matches = re.findall(r'\",\"app_name\":\"([^\"]+)\",\"', response.text)
326
+ linked_apps = list(set(apps_matches))
327
+ return linked_apps
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: odaislib
3
+ Version: 1.0.2
4
+ Summary: Facebook Authentication Library with multiple login methods
5
+ Home-page:
6
+ Author: Odai
7
+ Author-email: odaiobeidat00@gmail.com
8
+ Keywords: facebook,login,authentication,api,social
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: requests>=2.25.1
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: keywords
24
+ Dynamic: requires-dist
25
+ Dynamic: requires-python
26
+ Dynamic: summary
27
+
28
+ # Facebook Login Library
29
+ مكتبة بايثون لتسجيل الدخول إلى Facebook بعدة طرق.
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ k33kz/__init__.py
4
+ odaislib.egg-info/PKG-INFO
5
+ odaislib.egg-info/SOURCES.txt
6
+ odaislib.egg-info/dependency_links.txt
7
+ odaislib.egg-info/requires.txt
8
+ odaislib.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.25.1
@@ -0,0 +1 @@
1
+ k33kz
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,27 @@
1
+ from setuptools import setup, find_packages
2
+ with open("README.md", "r", encoding="utf-8") as fh:
3
+ long_description = fh.read()
4
+ setup(
5
+ name="odaislib",
6
+ version="1.0.2",
7
+ author="Odai",
8
+ author_email="odaiobeidat00@gmail.com",
9
+ description="Facebook Authentication Library with multiple login methods",
10
+ long_description=long_description,
11
+ long_description_content_type="text/markdown",
12
+ url="",
13
+ packages=find_packages(),
14
+ python_requires=">=3.6",
15
+ install_requires=[
16
+ "requests>=2.25.1",
17
+ ],
18
+ classifiers=[
19
+ "Programming Language :: Python :: 3",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: OS Independent",
22
+ "Development Status :: 4 - Beta",
23
+ "Intended Audience :: Developers",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ ],
26
+ keywords=["facebook", "login", "authentication", "api", "social"],
27
+ )