-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_about_you_human.py
More file actions
125 lines (113 loc) · 5.38 KB
/
patch_about_you_human.py
File metadata and controls
125 lines (113 loc) · 5.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import sys
with open('run_rotator_monolith.py', 'r') as f:
code = f.read()
# Ich entferne den kaputten "Gaplustos" Check, weil wir keinen brauchen, und baue den About-You AppleScript Check richtig ein!
old_block = """ # Gaplustos (Google ToS) Intercept!
for _ in range(5):
url_curr = getattr(tab, "url", getattr(tab.target, "url", ""))
if "gaplustos" in url_curr:
print("[BROWSER] 'Willkommen' ToS Screen erkannt. Akzeptiere...")
await tab.evaluate(\"\"\"
(() => {
const form = document.querySelector('form');
if (form) { form.submit(); return; }
const btns = document.querySelectorAll('button');
for (const b of btns) {
const t = (b.innerText||'').toLowerCase();
if (t.includes('verstanden') || t.includes('akzeptieren') || t.includes('weiter')) {
b.click(); return;
}
}
})()
\"\"\")
await asyncio.sleep(4)
break
await asyncio.sleep(1)
# About-You Screen Intercept!
for _ in range(5):
url2 = getattr(tab, "url", getattr(tab.target, "url", ""))
if "about-you" in url2:
print("[BROWSER] 'About You' (Alter bestätigen) Screen erkannt!")
await tab.save_screenshot(os.path.join(SCREENSHOT_DIR, "04b_about_you.png"))
import random
first_names = ["Lukas", "Leon", "Finn", "Paul", "Jonas", "Ben", "Elias", "Felix", "Noah", "David"]
last_names = ["Müller", "Schmidt", "Schneider", "Fischer", "Weber", "Meyer", "Wagner", "Becker"]
first_name = random.choice(first_names)
last_name = random.choice(last_names)
print(f"[BROWSER] Tippe echten Namen {first_name} {last_name} via AppleScript Keyboard...")
type_name = "\\n".join([f'keystroke "{c}"\\ndelay 0.1' for c in f"{first_name} {last_name}"])
type_bday = "\\n".join([f'keystroke "{c}"\\ndelay 0.1' for c in "01011990"])
script = f'''
tell application "Google Chrome" to activate
delay 1
tell application "System Events"
key code 48
delay 0.5
{type_name}
delay 0.8
key code 48
delay 0.5
{type_bday}
delay 0.8
key code 48
delay 0.5
key code 36
end tell
'''
import subprocess
subprocess.run(["osascript", "-e", script])
await tab.save_screenshot(os.path.join(SCREENSHOT_DIR, "04c_about_you_filled.png"))
print("[BROWSER] Name und Geburtstag ausgefuellt und uebermittelt!")
await asyncio.sleep(5)
break
await asyncio.sleep(1)"""
new_block = """ # About-You Screen Intercept!
for _ in range(15):
try:
url2 = getattr(tab, "url", getattr(tab.target, "url", ""))
if "gaplustos" in url2:
print("[BROWSER] Gaplustos (Google ToS) entdeckt! Sende ENTER zum Akzeptieren...")
import subprocess
subprocess.run(["osascript", "-e", 'tell application "Google Chrome" to activate\\ndelay 1\\ntell application "System Events"\\nkey code 36\\nend tell'])
await asyncio.sleep(4)
if "about-you" in url2:
print("[BROWSER] 'About You' (Alter bestätigen) Screen erkannt!")
import random
first_names = ["Lukas", "Leon", "Finn", "Paul", "Jonas", "Ben", "Elias", "Felix", "Noah", "David"]
last_names = ["Müller", "Schmidt", "Schneider", "Fischer", "Weber", "Meyer", "Wagner", "Becker"]
first_name = random.choice(first_names)
last_name = random.choice(last_names)
print(f"[BROWSER] Tippe echten Namen {first_name} {last_name} via AppleScript Keyboard...")
type_name = "\\n".join([f'keystroke "{c}"\\ndelay 0.1' for c in f"{first_name} {last_name}"])
type_bday = "\\n".join([f'keystroke "{c}"\\ndelay 0.1' for c in "01011990"])
script = f'''
tell application "Google Chrome" to activate
delay 1
tell application "System Events"
-- 1. Tab zum Namen
key code 48
delay 0.5
{type_name}
delay 0.8
-- 2. Tab zum Geburtstag
key code 48
delay 0.5
{type_bday}
delay 0.8
-- 3. Tab & Enter
key code 48
delay 0.5
key code 36
end tell
'''
import subprocess
subprocess.run(["osascript", "-e", script])
print("[BROWSER] Name und Geburtstag ausgefuellt und uebermittelt!")
await asyncio.sleep(5)
break
except: pass
await asyncio.sleep(1)"""
code = code.replace(old_block, new_block)
with open('run_rotator_monolith.py', 'w') as f:
f.write(code)
print("Patch applied for About-You Human Typing")