-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbets_main.py
More file actions
71 lines (60 loc) · 1.84 KB
/
bets_main.py
File metadata and controls
71 lines (60 loc) · 1.84 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
import string
from collections import defaultdict
import database
import time
import queue
import threading
from houses.Retabet import Retabet
from houses.Bwin import Bwin
from houses.WilliamHill import WilliamHill
from bet import Bet
def houses_exec(q, house):
for sport in house.sports:
house.sport_bets(sport)
for match in house.ret_bets[sport]:
if match.is_error():
continue
q.put(match)
def retorno(ca, cb):
return ca / (1 + (ca / cb))
reta = Retabet()
bwin = Bwin()
william_hill = WilliamHill()
house_list = [reta, bwin, william_hill]
while True:
match_dict = defaultdict(lambda: [])
threads = []
q = queue.Queue()
for house in house_list:
t = threading.Thread(target=houses_exec, args=(q, house,))
threads.append(t)
t.start()
for t in threads:
t.join()
for match in q.queue:
match_dict[match.hash()].append(match)
retornos = []
luck = False
cnt = 0
for key, match in match_dict.items():
if len(match) <= 1:
continue
cnt += 1
for m1 in match:
for m2 in match:
ret = retorno(m1.bets[0], m2.bets[1])
retornos.append((ret, m1, m2))
if ret >= 1:
print(ret)
print(m1, m2)
print(m1.link)
print(m2.link)
luck = True
retornos.sort(key=lambda x: x[0], reverse=True)
if len(retornos) and not luck:
print(f"No luck: {retornos[0][0], cnt}")
#time.sleep(5)
exit()
#retornos.sort(key=lambda x: x[0], reverse=True)
#for r in retornos[:10]:
# print(f"{r[0]}: {r[1], r[2]}")