woolbot commited on
Commit
aa6b547
·
1 Parent(s): 852b422

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +6 -1
utils.py CHANGED
@@ -8,12 +8,17 @@ from asyncio import sleep as asyncsleep
8
  from random import randint
9
 
10
  model = load_model("model.h5")
 
 
 
 
 
11
 
12
  async def get_binary_from_link(link: str) -> bytes:
13
  async with ClientSession() as session:
14
  for _ in range(20):
15
  try:
16
- a = await session.get(link)
17
  print(int(a.status))
18
  if int(a.status) == 200:
19
  return await a.read()
 
8
  from random import randint
9
 
10
  model = load_model("model.h5")
11
+ proxies = [
12
+ "http://207.180.218.96:80",
13
+ "http://82.66.27.145:8118",
14
+ "http://139.162.102.215:38118",
15
+ ]
16
 
17
  async def get_binary_from_link(link: str) -> bytes:
18
  async with ClientSession() as session:
19
  for _ in range(20):
20
  try:
21
+ a = await session.get(link, proxy=proxies[randint(0, len(proxies)-1)])
22
  print(int(a.status))
23
  if int(a.status) == 200:
24
  return await a.read()