odaislib 1.0.3__py3-none-any.whl → 1.0.6__py3-none-any.whl
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.
- k33kz/__init__.py +297 -1
- {odaislib-1.0.3.dist-info → odaislib-1.0.6.dist-info}/METADATA +1 -1
- odaislib-1.0.6.dist-info/RECORD +5 -0
- odaislib-1.0.3.dist-info/RECORD +0 -5
- {odaislib-1.0.3.dist-info → odaislib-1.0.6.dist-info}/WHEEL +0 -0
- {odaislib-1.0.3.dist-info → odaislib-1.0.6.dist-info}/top_level.txt +0 -0
k33kz/__init__.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#السكربت و المكتبة لعدي @K33Kz - @K33Ka
|
|
3
3
|
import requests,re,json,time;from uuid import uuid4
|
|
4
4
|
class basic:
|
|
5
|
+
@staticmethod
|
|
5
6
|
def login(email, password, proxies=None):
|
|
6
7
|
r = requests.get("https://www.facebook.com/?_rd")
|
|
7
8
|
m = re.search(r'privacy_mutation_token\s*["\']?\s*[:=]\s*["\']?([A-Za-z0-9_\-:.]+)', r.text)
|
|
@@ -99,6 +100,7 @@ class basic:
|
|
|
99
100
|
"by": "Odai - @K33Kz - @K33Ka"
|
|
100
101
|
})
|
|
101
102
|
class auth:
|
|
103
|
+
@staticmethod
|
|
102
104
|
def login(email, password,proxies=None):
|
|
103
105
|
data = {
|
|
104
106
|
"locale": "en_GB",
|
|
@@ -142,6 +144,7 @@ class auth:
|
|
|
142
144
|
"by": "Odai - @K33Kz - @K33Ka"
|
|
143
145
|
}
|
|
144
146
|
class mobile:
|
|
147
|
+
@staticmethod
|
|
145
148
|
def login(email, password, proxies=None):
|
|
146
149
|
payload = {
|
|
147
150
|
'method': "post",
|
|
@@ -313,6 +316,7 @@ class mobile:
|
|
|
313
316
|
|
|
314
317
|
}
|
|
315
318
|
class apps:
|
|
319
|
+
@staticmethod
|
|
316
320
|
def get_linked_apps(cookies):
|
|
317
321
|
headers = {
|
|
318
322
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
|
|
@@ -324,4 +328,296 @@ class apps:
|
|
|
324
328
|
response = requests.get("https://www.facebook.com/settings?tab=applications&ref=settings",headers=headers)
|
|
325
329
|
apps_matches = re.findall(r'\",\"app_name\":\"([^\"]+)\",\"', response.text)
|
|
326
330
|
linked_apps = list(set(apps_matches))
|
|
327
|
-
return linked_apps
|
|
331
|
+
return linked_apps
|
|
332
|
+
import requests, re, json, time, os, random
|
|
333
|
+
from typing import Optional, Dict, Any, Tuple
|
|
334
|
+
from datetime import datetime
|
|
335
|
+
|
|
336
|
+
class InstaResetTool:
|
|
337
|
+
@staticmethod
|
|
338
|
+
class InstaClient:
|
|
339
|
+
def __init__(self):
|
|
340
|
+
self.session = requests.Session()
|
|
341
|
+
self.csrf_token = None
|
|
342
|
+
self.response_history = []
|
|
343
|
+
self.session.headers.update({
|
|
344
|
+
"User-Agent": "Instagram 320.0.0.34.109 Android (33/13; 420dpi; 1080x2340; samsung; SM-A546B; a54x; exynos1380; en_US; 465123678)",
|
|
345
|
+
'X-IG-App-Startup-Country': 'US',
|
|
346
|
+
'X-Bloks-Version-Id': 'ce555e5500576acd8e84a66018f54a05720f2dce29f0bb5a1f97f0c10d6fac48',
|
|
347
|
+
'X-IG-App-ID': '567067343352427',
|
|
348
|
+
'X-IG-Connection-Type': 'WIFI',
|
|
349
|
+
"Accept": "*/*",
|
|
350
|
+
"Accept-Language": "en-US,en;q=0.9",
|
|
351
|
+
'accept-encoding': 'gzip, deflate',
|
|
352
|
+
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
353
|
+
"Connection": "keep-alive",
|
|
354
|
+
"Origin": "https://www.instagram.com",
|
|
355
|
+
"Referer": "https://www.instagram.com/",
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
def cev1(self, text: str) -> Optional[str]:
|
|
359
|
+
patterns = [
|
|
360
|
+
r'"csrf_token":"(.*?)"',
|
|
361
|
+
r'csrftoken=([a-zA-Z0-9]+)',
|
|
362
|
+
]
|
|
363
|
+
for p in patterns:
|
|
364
|
+
m = re.search(p, text)
|
|
365
|
+
if m:
|
|
366
|
+
self.csrf_token = m.group(1)
|
|
367
|
+
self.session.headers["X-CSRFToken"] = self.csrf_token
|
|
368
|
+
return self.csrf_token
|
|
369
|
+
return None
|
|
370
|
+
|
|
371
|
+
def cev2(self, url: str) -> Optional[requests.Response]:
|
|
372
|
+
try:
|
|
373
|
+
r = self.session.get(url, timeout=10)
|
|
374
|
+
self.response_history.append({
|
|
375
|
+
"timestamp": datetime.now().isoformat(),
|
|
376
|
+
"url": url,
|
|
377
|
+
"method": "GET",
|
|
378
|
+
"status_code": r.status_code,
|
|
379
|
+
"cookies": dict(self.session.cookies),
|
|
380
|
+
"csrf_token": self.csrf_token
|
|
381
|
+
})
|
|
382
|
+
self.cev1(r.text)
|
|
383
|
+
return r
|
|
384
|
+
except Exception as e:
|
|
385
|
+
self.response_history.append({
|
|
386
|
+
"timestamp": datetime.now().isoformat(),
|
|
387
|
+
"url": url,
|
|
388
|
+
"method": "GET",
|
|
389
|
+
"error": str(e),
|
|
390
|
+
"cookies": dict(self.session.cookies)
|
|
391
|
+
})
|
|
392
|
+
return None
|
|
393
|
+
|
|
394
|
+
def cev3(self, url: str, data=None, extra_headers=None):
|
|
395
|
+
headers = self.session.headers.copy()
|
|
396
|
+
if extra_headers:
|
|
397
|
+
headers.update(extra_headers)
|
|
398
|
+
|
|
399
|
+
try:
|
|
400
|
+
r = self.session.post(url, data=data, headers=headers, timeout=10)
|
|
401
|
+
|
|
402
|
+
response_data = {
|
|
403
|
+
"timestamp": datetime.now().isoformat(),
|
|
404
|
+
"url": url,
|
|
405
|
+
"method": "POST",
|
|
406
|
+
"status_code": r.status_code,
|
|
407
|
+
"cookies": dict(self.session.cookies),
|
|
408
|
+
"request_data": data,
|
|
409
|
+
"content_length": len(r.content),
|
|
410
|
+
"response_time": r.elapsed.total_seconds()
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
self.response_history.append(response_data)
|
|
414
|
+
|
|
415
|
+
if r.status_code == 200 and len(r.content) > 100:
|
|
416
|
+
return True, r, response_data
|
|
417
|
+
|
|
418
|
+
return False, r, response_data
|
|
419
|
+
|
|
420
|
+
except Exception as e:
|
|
421
|
+
self.response_history.append({
|
|
422
|
+
"timestamp": datetime.now().isoformat(),
|
|
423
|
+
"url": url,
|
|
424
|
+
"method": "POST",
|
|
425
|
+
"error": str(e),
|
|
426
|
+
"request_data": data,
|
|
427
|
+
"cookies": dict(self.session.cookies)
|
|
428
|
+
})
|
|
429
|
+
return False, None, None
|
|
430
|
+
|
|
431
|
+
@staticmethod
|
|
432
|
+
def generate_jazoest(email_or_username: str) -> str:
|
|
433
|
+
return "21885"
|
|
434
|
+
|
|
435
|
+
@staticmethod
|
|
436
|
+
def extract_instagram_info(response: requests.Response) -> Dict[str, Any]:
|
|
437
|
+
info = {
|
|
438
|
+
"raw_response": response.text if hasattr(response, 'text') else None,
|
|
439
|
+
"content_length": len(response.content) if hasattr(response, 'content') else 0,
|
|
440
|
+
"elapsed_time": response.elapsed.total_seconds() if hasattr(response, 'elapsed') else 0,
|
|
441
|
+
"url": response.url if hasattr(response, 'url') else None,
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if hasattr(response, 'headers'):
|
|
445
|
+
headers = dict(response.headers)
|
|
446
|
+
info["headers"] = headers
|
|
447
|
+
|
|
448
|
+
instagram_headers = {}
|
|
449
|
+
for key, value in headers.items():
|
|
450
|
+
if any(ig_key in key.lower() for ig_key in ['ig', 'instagram', 'x-ig']):
|
|
451
|
+
instagram_headers[key] = value
|
|
452
|
+
info["instagram_headers"] = instagram_headers
|
|
453
|
+
|
|
454
|
+
try:
|
|
455
|
+
json_data = response.json()
|
|
456
|
+
info["json_response"] = json_data
|
|
457
|
+
|
|
458
|
+
if isinstance(json_data, dict):
|
|
459
|
+
info["instagram_status"] = json_data.get("status", "unknown")
|
|
460
|
+
info["instagram_message"] = json_data.get("message", json_data.get("error_message"))
|
|
461
|
+
info["instagram_user_id"] = json_data.get("user_id", json_data.get("pk"))
|
|
462
|
+
info["instagram_username"] = json_data.get("username")
|
|
463
|
+
info["instagram_email"] = json_data.get("email")
|
|
464
|
+
info["instagram_challenge_required"] = json_data.get("challenge_required", False)
|
|
465
|
+
info["instagram_two_factor_required"] = json_data.get("two_factor_required", False)
|
|
466
|
+
info["instagram_contact_point"] = json_data.get("contact_point")
|
|
467
|
+
info["instagram_obfuscated_contact_point"] = json_data.get("obfuscated_contact_point")
|
|
468
|
+
|
|
469
|
+
if "checkpoint_url" in json_data:
|
|
470
|
+
info["checkpoint_required"] = True
|
|
471
|
+
info["checkpoint_url"] = json_data.get("checkpoint_url")
|
|
472
|
+
if "flow_render_type" in json_data:
|
|
473
|
+
info["flow_type"] = json_data.get("flow_render_type")
|
|
474
|
+
|
|
475
|
+
except:
|
|
476
|
+
info["json_response"] = None
|
|
477
|
+
info["raw_text"] = response.text[:500] + "..." if hasattr(response, 'text') and len(response.text) > 500 else response.text if hasattr(response, 'text') else None
|
|
478
|
+
|
|
479
|
+
return info
|
|
480
|
+
|
|
481
|
+
def reset_password(self, username: str) -> Dict[str, Any]:
|
|
482
|
+
client = self.InstaClient()
|
|
483
|
+
|
|
484
|
+
client.cev2("https://www.instagram.com/")
|
|
485
|
+
time.sleep(random.uniform(0.1, 0.2))
|
|
486
|
+
|
|
487
|
+
client.cev2("https://www.instagram.com/accounts/password/reset/")
|
|
488
|
+
|
|
489
|
+
jazoest_value = self.generate_jazoest(username)
|
|
490
|
+
|
|
491
|
+
payload = {
|
|
492
|
+
"email_or_username": username,
|
|
493
|
+
"jazoest": jazoest_value,
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
success, response, request_data = client.cev3(
|
|
497
|
+
"https://www.instagram.com/api/v1/web/accounts/account_recovery_send_ajax/",
|
|
498
|
+
data=payload,
|
|
499
|
+
extra_headers={"X-Requested-With": "XMLHttpRequest"}
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
result = {
|
|
503
|
+
"request_info": {
|
|
504
|
+
"timestamp": datetime.now().isoformat(),
|
|
505
|
+
"username": username,
|
|
506
|
+
"jazoest": jazoest_value,
|
|
507
|
+
"payload": payload,
|
|
508
|
+
"endpoint": "https://www.instagram.com/api/v1/web/accounts/account_recovery_send_ajax/",
|
|
509
|
+
"method": "POST"
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
"session_info": {
|
|
513
|
+
"csrf_token": client.csrf_token,
|
|
514
|
+
"cookies": dict(client.session.cookies),
|
|
515
|
+
"user_agent": client.session.headers.get("User-Agent"),
|
|
516
|
+
"app_id": client.session.headers.get("X-IG-App-ID"),
|
|
517
|
+
"bloks_version": client.session.headers.get("X-Bloks-Version-Id"),
|
|
518
|
+
},
|
|
519
|
+
|
|
520
|
+
"request_history": client.response_history,
|
|
521
|
+
|
|
522
|
+
"reset_response": {
|
|
523
|
+
"success": success,
|
|
524
|
+
"status_code": response.status_code if response else None,
|
|
525
|
+
"instagram_info": self.extract_instagram_info(response) if response else None,
|
|
526
|
+
},
|
|
527
|
+
|
|
528
|
+
"response_analysis": {}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if response:
|
|
532
|
+
analysis = {
|
|
533
|
+
"is_successful": success,
|
|
534
|
+
"is_instagram_response": response.status_code == 200 and len(response.content) > 100,
|
|
535
|
+
"has_json": False,
|
|
536
|
+
"instagram_status": None,
|
|
537
|
+
"email_sent": False,
|
|
538
|
+
"challenge_required": False,
|
|
539
|
+
"user_exists": None,
|
|
540
|
+
"possible_errors": []
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
try:
|
|
544
|
+
json_data = response.json()
|
|
545
|
+
analysis["has_json"] = True
|
|
546
|
+
analysis["instagram_status"] = json_data.get("status")
|
|
547
|
+
analysis["instagram_message"] = json_data.get("message")
|
|
548
|
+
|
|
549
|
+
if json_data.get("status") == "ok" or json_data.get("message") in ["Email sent", "Password reset email sent"]:
|
|
550
|
+
analysis["email_sent"] = True
|
|
551
|
+
|
|
552
|
+
if json_data.get("status") == "ok":
|
|
553
|
+
analysis["user_exists"] = True
|
|
554
|
+
elif "user" in json_data.get("message", "").lower() or "account" in json_data.get("message", "").lower():
|
|
555
|
+
analysis["user_exists"] = False
|
|
556
|
+
analysis["possible_errors"].append("USER_NOT_FOUND")
|
|
557
|
+
|
|
558
|
+
if json_data.get("challenge_required") or json_data.get("checkpoint_url"):
|
|
559
|
+
analysis["challenge_required"] = True
|
|
560
|
+
analysis["possible_errors"].append("CHALLENGE_REQUIRED")
|
|
561
|
+
|
|
562
|
+
except:
|
|
563
|
+
pass
|
|
564
|
+
|
|
565
|
+
if response.status_code == 200:
|
|
566
|
+
analysis["possible_errors"].append("NONE")
|
|
567
|
+
elif response.status_code == 400:
|
|
568
|
+
analysis["possible_errors"].append("BAD_REQUEST")
|
|
569
|
+
elif response.status_code == 403:
|
|
570
|
+
analysis["possible_errors"].append("FORBIDDEN")
|
|
571
|
+
elif response.status_code == 429:
|
|
572
|
+
analysis["possible_errors"].append("RATE_LIMIT")
|
|
573
|
+
elif response.status_code >= 500:
|
|
574
|
+
analysis["possible_errors"].append("SERVER_ERROR")
|
|
575
|
+
|
|
576
|
+
result["response_analysis"] = analysis
|
|
577
|
+
|
|
578
|
+
result["summary"] = {
|
|
579
|
+
"username": username,
|
|
580
|
+
"request_made": True,
|
|
581
|
+
"instagram_responded": response is not None,
|
|
582
|
+
"final_status": "SUCCESS" if success else "FAILED" if response else "ERROR",
|
|
583
|
+
"email_possibly_sent": result.get("response_analysis", {}).get("email_sent", False),
|
|
584
|
+
"user_likely_exists": result.get("response_analysis", {}).get("user_exists"),
|
|
585
|
+
"timestamp_completed": datetime.now().isoformat(),
|
|
586
|
+
"total_time": sum(item.get("response_time", 0) for item in client.response_history if "response_time" in item)
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return result
|
|
590
|
+
|
|
591
|
+
def get_full_response(self, username: str) -> Dict[str, Any]:
|
|
592
|
+
return self.reset_password(username)
|
|
593
|
+
|
|
594
|
+
def analyze_response_only(self, response_text: str) -> Dict[str, Any]:
|
|
595
|
+
class MockResponse:
|
|
596
|
+
def __init__(self, text):
|
|
597
|
+
self.text = text
|
|
598
|
+
self.content = text.encode('utf-8') if text else b''
|
|
599
|
+
self.headers = {}
|
|
600
|
+
self.status_code = 200
|
|
601
|
+
self.elapsed = type('obj', (object,), {'total_seconds': lambda: 0})()
|
|
602
|
+
self.url = "https://www.instagram.com/api/v1/web/accounts/account_recovery_send_ajax/"
|
|
603
|
+
|
|
604
|
+
mock_response = MockResponse(response_text)
|
|
605
|
+
return self.extract_instagram_info(mock_response)
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
def cev6(usernames) -> Dict[str, Any]:
|
|
609
|
+
tool = InstaResetTool()
|
|
610
|
+
|
|
611
|
+
if isinstance(usernames, str):
|
|
612
|
+
username = usernames
|
|
613
|
+
elif isinstance(usernames, list) and len(usernames) > 0:
|
|
614
|
+
username = usernames[0]
|
|
615
|
+
else:
|
|
616
|
+
return {"status": "error", "message": "Invalid username input"}
|
|
617
|
+
|
|
618
|
+
return tool.reset_password(username)
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
def reset_password(username: str) -> Dict[str, Any]:
|
|
622
|
+
tool = InstaResetTool()
|
|
623
|
+
return tool.reset_password(username)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
k33kz/__init__.py,sha256=g3AIzSynEOFVQ8GyT5Sfqg9WdDIU2U7a65KyxIR98XI,28174
|
|
2
|
+
odaislib-1.0.6.dist-info/METADATA,sha256=hboPkqcIhNTp0qcrvHJXlt7CdBAyxKFPH0yvLkJFv-A,941
|
|
3
|
+
odaislib-1.0.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
+
odaislib-1.0.6.dist-info/top_level.txt,sha256=3wvp4V0a1Vuwng0HAuy3i2gDSQrn0GznidyGoby2Gcc,6
|
|
5
|
+
odaislib-1.0.6.dist-info/RECORD,,
|
odaislib-1.0.3.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
k33kz/__init__.py,sha256=bzyVfIXPLSlBUOiTdPVoFJORHNvPo9xhkpJnasXoDdA,15619
|
|
2
|
-
odaislib-1.0.3.dist-info/METADATA,sha256=iva-4T13NWdPrV57KvL57a5I6wZTdVCfud5E9XjGt6k,941
|
|
3
|
-
odaislib-1.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
4
|
-
odaislib-1.0.3.dist-info/top_level.txt,sha256=3wvp4V0a1Vuwng0HAuy3i2gDSQrn0GznidyGoby2Gcc,6
|
|
5
|
-
odaislib-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|