q6 commited on
Commit
defc92b
·
1 Parent(s): f213af5

Lowered semaphore

Browse files
Files changed (2) hide show
  1. API/app.py +3 -3
  2. Client/hunt.py +1 -1
API/app.py CHANGED
@@ -229,7 +229,7 @@ async def pixif(
229
  items: pixifModel
230
  ):
231
  post_ids = items.post_ids
232
- semaphore = asyncio.Semaphore(1000)
233
 
234
  async with aiohttp.ClientSession(cookies=cookies, headers=headers) as session:
235
  tasks = [process_post(post_id, session, semaphore) for post_id in post_ids]
@@ -239,7 +239,7 @@ async def pixif(
239
  return image_exifs
240
 
241
  async def generate_zstd_archive(posts, session):
242
- semaphore = asyncio.Semaphore(1000)
243
  images = {}
244
 
245
  async def fetch_image(post_id, image_url):
@@ -279,7 +279,7 @@ async def download(
279
  async with aiohttp.ClientSession(cookies=cookies, headers=headers) as session:
280
  temp_file = await generate_zstd_archive(posts, session)
281
 
282
- filename = f"{base26_time()}.zstd"
283
 
284
  return FileResponse(
285
  path=temp_file.name,
 
229
  items: pixifModel
230
  ):
231
  post_ids = items.post_ids
232
+ semaphore = asyncio.Semaphore(100)
233
 
234
  async with aiohttp.ClientSession(cookies=cookies, headers=headers) as session:
235
  tasks = [process_post(post_id, session, semaphore) for post_id in post_ids]
 
239
  return image_exifs
240
 
241
  async def generate_zstd_archive(posts, session):
242
+ semaphore = asyncio.Semaphore(100)
243
  images = {}
244
 
245
  async def fetch_image(post_id, image_url):
 
279
  async with aiohttp.ClientSession(cookies=cookies, headers=headers) as session:
280
  temp_file = await generate_zstd_archive(posts, session)
281
 
282
+ filename = f"{base26_time()}.tar.zstd"
283
 
284
  return FileResponse(
285
  path=temp_file.name,
Client/hunt.py CHANGED
@@ -5,7 +5,7 @@ import io
5
  import tarfile
6
  import zstandard
7
 
8
- local = 0
9
  if local:
10
  endpoint = "http://127.0.0.1:7860"
11
  else:
 
5
  import tarfile
6
  import zstandard
7
 
8
+ local = 1
9
  if local:
10
  endpoint = "http://127.0.0.1:7860"
11
  else: