universal-slider-bypass 1.0.0__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,19 @@
1
+ Copyright (c) 2026 TITAN
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: universal-slider-bypass
3
+ Version: 1.0.0
4
+ Summary: A universal automated slider captcha solver using Computer Vision and Playwright.
5
+ Author-email: TITAN <titan@example.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: opencv-python>=4.0.0
13
+ Requires-Dist: numpy>=1.20.0
14
+ Dynamic: license-file
15
+
16
+ # Universal Slider Captcha Bypass
17
+
18
+ An open-source Python library to automate and solve any **Slider Captcha** using OpenCV (Computer Vision) and Playwright.
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ pip install universal-slider-bypass
@@ -0,0 +1,8 @@
1
+ # Universal Slider Captcha Bypass
2
+
3
+ An open-source Python library to automate and solve any **Slider Captcha** using OpenCV (Computer Vision) and Playwright.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install universal-slider-bypass
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "universal-slider-bypass"
7
+ version = "1.0.0"
8
+ authors = [
9
+ { name="TITAN", email="titan@example.com" }
10
+ ]
11
+ description = "A universal automated slider captcha solver using Computer Vision and Playwright."
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ dependencies = [
20
+ "opencv-python>=4.0.0",
21
+ "numpy>=1.20.0"
22
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from .solver import UniversalSliderSolver
@@ -0,0 +1,107 @@
1
+ import cv2 as cv
2
+ import numpy as np
3
+ import random
4
+ import asyncio
5
+
6
+
7
+ class UniversalSliderSolver:
8
+ """
9
+ المكتبة العامة لتخطي كابتشا السحب (Slider Captcha)
10
+ تدعم معالجة الصور الديناميكية والمحاكاة الفيزيائية لحركة اليد البشرية.
11
+ """
12
+
13
+ def __init__(self, page_url=None):
14
+ self.page_url = page_url
15
+ self.custom_adapters = {}
16
+
17
+ def register_adapter(self, site_name, adapter_function):
18
+ """ميزة للمطورين: تسمح بإضافة أداة مخصصة لموقع معين"""
19
+ self.custom_adapters[site_name.lower()] = adapter_function
20
+ print(f"[+] Registered custom adapter for: {site_name}")
21
+
22
+ @staticmethod
23
+ def _calculate_distance(bg_bytes, puzzle_bytes):
24
+ """تحليل حواف صيد البكسل الدقيق لمكان القطعة الناقصة"""
25
+ bg_img = cv.imdecode(np.frombuffer(bg_bytes, np.uint8), cv.IMREAD_COLOR)
26
+ puzzle_img = cv.imdecode(np.frombuffer(puzzle_bytes, np.uint8), cv.IMREAD_COLOR)
27
+
28
+ if bg_img is None or puzzle_img is None:
29
+ raise ValueError("[-] Failed to decode image bytes.")
30
+
31
+ # تحويل الألوان واكتشاف الخطوط الخارجية عبر فلتر Canny
32
+ bg_edges = cv.Canny(cv.cvtColor(bg_img, cv.COLOR_BGR2GRAY), 100, 200)
33
+ puzzle_edges = cv.Canny(cv.cvtColor(puzzle_img, cv.COLOR_BGR2GRAY), 100, 200)
34
+
35
+ # مطابقة الحواف (Template Matching)
36
+ result = cv.matchTemplate(bg_edges, puzzle_edges, cv.TM_CCOEFF)
37
+ _, _, _, max_loc = cv.minMaxLoc(result)
38
+ return max_loc[0]
39
+
40
+ @staticmethod
41
+ def _generate_human_track(distance):
42
+ """توليد مسارات حركة عشوائية (تسارع وتباطؤ) تحاكي اليد البشرية"""
43
+ track = []
44
+ current = 0
45
+ mid = distance * 4 / 5 # نقطة التحول للتباطؤ
46
+ t = 0.2
47
+ v = 0
48
+
49
+ while current < distance:
50
+ a = 3 if current < mid else -4
51
+ v0 = v
52
+ v = v0 + a * t
53
+ move = v0 * t + 0.5 * a * (t ** 2)
54
+ current += int(move)
55
+ track.append(int(move))
56
+
57
+ offset = distance - sum(track)
58
+ if offset != 0:
59
+ track.append(offset)
60
+ return track
61
+
62
+ async def solve(self, page, bg_selector, puzzle_selector, handle_selector, site_key=None):
63
+ """المحرك الرئيسي للتخطي الأوتوماتيكي عبر محاكاة الماوس داخل المتصفح"""
64
+ if site_key and site_key.lower() in self.custom_adapters:
65
+ print(f"[!] Custom adapter detected for {site_key}. Switching control...")
66
+ return await self.custom_adapters[site_key.lower()](page, self)
67
+
68
+ try:
69
+ # انتصار سيلكتورز العناصر في الواجهة
70
+ bg_element = await page.wait_for_selector(bg_selector)
71
+ puzzle_element = await page.wait_for_selector(puzzle_selector)
72
+ handle_element = await page.wait_for_selector(handle_selector)
73
+
74
+ # التقاط صور حية من المتصفح كبايتات
75
+ bg_bytes = await bg_element.screenshot()
76
+ puzzle_bytes = await puzzle_element.screenshot()
77
+
78
+ # حساب المسافة
79
+ distance = self._calculate_distance(bg_bytes, puzzle_bytes)
80
+ print(f"[+] Calculated distance: {distance} px")
81
+
82
+ # جلب إحداثيات زر السحب
83
+ handle_box = await handle_element.bounding_box()
84
+ start_x = handle_box['x'] + handle_box['width'] / 2
85
+ start_y = handle_box['y'] + handle_box['height'] / 2
86
+
87
+ # الضغط على زر السحب
88
+ await page.mouse.move(start_x, start_y)
89
+ await page.mouse.down()
90
+
91
+ # تحريك السلايدر بناءً على المسار البشري المولد
92
+ track = self._generate_human_track(distance)
93
+ current_x = start_x
94
+
95
+ for move in track:
96
+ current_x += move
97
+ # اهتزاز خفيف جداً على محور Y لمنع كشف البوت
98
+ shake_y = start_y + random.uniform(-1, 1)
99
+ await page.mouse.move(current_x, shake_y)
100
+ await asyncio.sleep(random.uniform(0.01, 0.03))
101
+
102
+ await page.mouse.up()
103
+ print("[🎉] Slider bypass operation completed.")
104
+ return True
105
+ except Exception as e:
106
+ print(f"[-] Error during slider bypass: {e}")
107
+ return False
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: universal-slider-bypass
3
+ Version: 1.0.0
4
+ Summary: A universal automated slider captcha solver using Computer Vision and Playwright.
5
+ Author-email: TITAN <titan@example.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: opencv-python>=4.0.0
13
+ Requires-Dist: numpy>=1.20.0
14
+ Dynamic: license-file
15
+
16
+ # Universal Slider Captcha Bypass
17
+
18
+ An open-source Python library to automate and solve any **Slider Captcha** using OpenCV (Computer Vision) and Playwright.
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ pip install universal-slider-bypass
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/universal_slider/__init__.py
5
+ src/universal_slider/solver.py
6
+ src/universal_slider_bypass.egg-info/PKG-INFO
7
+ src/universal_slider_bypass.egg-info/SOURCES.txt
8
+ src/universal_slider_bypass.egg-info/dependency_links.txt
9
+ src/universal_slider_bypass.egg-info/requires.txt
10
+ src/universal_slider_bypass.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ opencv-python>=4.0.0
2
+ numpy>=1.20.0