decodo-register · VibeGit
decodo-register decodo-register — авторег Decodo (free DC proxies)
Decodo (ex-Smartproxy) даёт 1 GB datacenter-прокси трафика в месяц бесплатно на аккаунт: без карты, только подтверждение почты. Реггер делает аккаунты пачками и складывает в банк рабочие username:password к dc.decodo.com:10000.
decodo-register / core / turnstile.py 125 строк · изменён 14 нояб., 06:52
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
"""Turnstile: бесплатный минт через camoufox (локально), платный fallback — capsolver.
solve(url, sitekey, proxy) → token | None
Режим выбирается config.turnstile_solver: camoufox | capsolver | auto.
"""
import json
import os
import subprocess
import time
import requests
from . import config
_MINT_SCRIPT = os. path. join( os. path. dirname( os. path. abspath( __file__) ) , "camoufox_mint.py" )
def mint_camoufox ( url, sitekey= None , proxy= None , timeout= 120 , headed= False ) :
"""Токен через локальный camoufox ($0). None при фейле.
headed=True — видимое окно для ручного прохождения капчи; таймаут
поднимаем до 5 минут (скрипт внутри ждёт токен ~4 мин).
"""
py = config. CAMOUFOX_PYTHON
if not os. path exists py
cmd py _MINT_SCRIPT url sitekey config TURNSTILE_SITEKEY
proxy
cmd proxy
headed
cmd
timeout timeout
env k v k v os environ items
k
p subprocess run cmd capture_output text timeout timeout env env
subprocess TimeoutExpired
line p stdout strip splitlines
line
data json loads line
ValueError
data get
data
url sitekey timeout poll
key config CAPSOLVER_API_KEY
key
r requests post
json key
url
sitekey config TURNSTILE_SITEKEY
timeout
data r json
Exception exc
data get
task_id data
deadline time time timeout
time time deadline
time sleep poll
data requests post
json key task_id timeout json
Exception
data get
data
data get
url proxy sitekey
mode config TURNSTILE_SOLVER lower
mint_proxy config TURNSTILE_MINT_DIRECT proxy
mint_proxy proxy config TURNSTILE_MINT_DIRECT
mode
token mint_camoufox url sitekey proxy mint_proxy
headed config get
token mode
token
mode
solve_capsolver url sitekey
.
(
)
:
print
(
f" [turnstile] camoufox-python не найден: { py} "
)
return
None
=
[
,
"-P"
,
,
,
or
.
]
if
:
+=
[
"--proxy"
,
]
if
:
+=
[
"--headed"
]
=
max
(
,
300
)
print
(
" [turnstile] ОКНО camoufox открыто — пройди капчу руками, "
"токен подхватится автоматически"
)
=
{
:
for
,
in
.
.
(
)
if
not
in
(
"PYTHONHOME"
,
"PYTHONPATH"
,
"LD_LIBRARY_PATH"
)
}
try
:
=
.
(
,
=
True
,
=
True
,
=
,
=
)
except
.
:
print
(
" [turnstile] camoufox: таймаут"
)
return
None
=
(
.
or
""
)
.
(
)
.
(
)
if
not
:
print
(
f" [turnstile] camoufox: пустой вывод (rc= { p. returncode} ) { ( p. stderr or '' ) [ - 200 : ] } "
)
return
None
try
:
=
.
(
[
-
1
]
)
except
:
print
(
f" [turnstile] camoufox: мусор в выводе: { line[ - 1 ] [ : 160] } "
)
return
None
if
.
(
"token"
)
:
print
(
f" [turnstile] camoufox: токен за { data. get( 'seconds' , '?' ) } с ($0)"
)
return
[
"token"
]
print
(
f" [turnstile] camoufox: { data. get( 'error' , 'нет токена' ) } "
)
return
None
def
solve_capsolver
(
,
=
None
,
=
90
,
=
3
)
:
"""Токен через capsolver (~$0.003). None при фейле/нет ключа."""
=
.
if
not
:
print
(
" [turnstile] capsolver: нет ключа в config.json"
)
return
None
try
:
=
.
(
"https://api.capsolver.com/createTask"
,
=
{
"clientKey"
:
,
"task"
:
{
"type"
:
"AntiTurnstileTaskProxyLess"
,
"websiteURL"
:
,
"websiteKey"
:
or
.
,
}
}
,
=
15
)
=
.
(
)
except
as
:
print
(
f" [turnstile] capsolver createTask: { exc} "
)
return
None
if
.
(
"errorId"
)
!=
0
:
print
(
f" [turnstile] capsolver: { data. get( 'errorDescription' , data) } "
)
return
None
=
[
"taskId"
]
=
.
(
)
+
while
.
(
)
<
:
.
(
)
try
:
=
.
(
"https://api.capsolver.com/getTaskResult"
,
=
{
"clientKey"
:
,
"taskId"
:
}
,
=
10
)
.
(
)
except
:
continue
if
.
(
"status"
)
==
"ready"
:
print
(
" [turnstile] capsolver: токен получен"
)
return
[
"solution"
]
[
"token"
]
if
.
(
"errorId"
)
!=
0
:
print
(
f" [turnstile] capsolver: { data. get( 'errorDescription' , data) } "
)
return
None
print
(
" [turnstile] capsolver: таймаут"
)
return
None
def
solve
(
,
=
None
,
=
None
)
:
"""Единая точка: режим из конфига, auto = camoufox → capsolver.
turnstile_mint_direct=True → минт идёт с домашнего IP, даже если регистрация
через прокси (под datacenter-IP tokenharbor не отрисовывает виджет Turnstile,
см. config.py). Turnstile не привязывает токен к IP сабмита.
"""
=
(
.
or
"auto"
)
.
(
)
=
None
if
.
else
if
is
None
and
and
.
:
print
(
" [turnstile] минт напрямую (домашний IP), регистрация через прокси"
)
if
in
(
"camoufox"
,
"auto"
)
:
=
(
,
,
=
,
=
bool
(
.
(
"turnstile_headed"
,
False
)
)
)
if
or
==
"camoufox"
:
return
if
in
(
"capsolver"
,
"auto"
)
:
return
(
,
)
print
(
f" [turnstile] неизвестный режим: { mode} "
)
return
None