-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProxyManager.py
executable file
·49 lines (49 loc) · 2.83 KB
/
ProxyManager.py
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
from threading import Lock
import time
if 100 - 100: Oo / Ii * oO0OOoOOO0OO0
class PM_ :
if 31 - 31: o000 + iIiIi1i1II11 . I111Iiii11 . iiII1i1i1I1iI - iiI
def __init__ ( self ) :
self . timestamps = dict ( )
self . proxies = open ( 'proxies.txt' ) . read ( ) . split ( '\n' )
self . kstack = self . proxies [ : ]
self . badProxies = list ( )
self . coolProxy = ''
self . lk = Lock ( )
if 56 - 56: oo0O00oooo / IIii / OO0OOoO00OooO . O0oOoo00o - IiiIiIi1i1I1
def getProxy ( self ) :
with self . lk :
while True :
try :
IiOOOoO0O0ooO0 = self . kstack . pop ( 0 ) . replace ( '\n' , '' )
try :
if time . time ( ) - 4 >= self . timestamps [ IiOOOoO0O0ooO0 ] :
staf . kstack . append ( IiOOOoO0O0ooO0 )
continue
except :
pass
if 87 - 87: ii
self . timestamps [ IiOOOoO0O0ooO0 ] = time . time ( )
except IndexError :
self . kstack = self . proxies [ : ]
continue
staf . kstack . append ( IiOOOoO0O0ooO0 )
if 45 - 45: oOoo00oO0OO
if IiOOOoO0O0ooO0 . replace ( '\n' , '' ) . replace ( '\r' , '' ) != '' :
return IiOOOoO0O0ooO0 . replace ( '\n' , '' ) . replace ( '\r' , '' )
if 7 - 7: OOoOoo
def markAsCoolProxy ( self , kl ) :
with self . lk :
return
if 41 - 41: IIi1iii11 + i1i1I1II * I1iIIiIi
def badProxy ( self , kl ) :
pass
if 4 - 4: I1
if 5 - 5: I1 * Ii % I111Iiii11 % IIi1iii11
instance = PM_ ( )
getProxy = instance . getProxy
badProxy = instance . badProxy
coolProxy = instance . markAsCoolProxy
if 32 - 32: oo0O00oooo + Oo - I1 - i1i1I1II . IIii - IIii
if 34 - 34: i1i1I1II / IIi1iii11 * OOoOoo . OOoOoo
if 25 - 25: Ii * i1i1I1II