fix: 少个参数

This commit is contained in:
ikun
2024-09-20 21:35:00 +08:00
parent 4aa1c22c25
commit e34cad1889
2 changed files with 5 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ async def main(app_id, repos):
collected_depots.extend(result)
if collected_depots:
if isSteamTools:
migrate(st_use=True)
await migrate(st_use=True, session=session)
await stool_add(collected_depots, app_id)
log.info(' ✅ 找到SteamTools已添加解锁文件')
if isGreenLuma:

View File

@@ -35,20 +35,20 @@ async def migrate(st_use, session):
async with session.get(down_url, stream=True) as r:
if r.status == 200:
total_size = int(r.headers.get('Content-Length', 0))
total_size = int(await r.headers.get('Content-Length', 0))
chunk_size = 8192
progress = tqdm(total=total_size, unit='B', unit_scale=True)
async with aiofiles.open(out_path, mode='wb') as f:
async for chunk in r.content.iter_chunked(chunk_size=chunk_size):
await f.write(chunk)
progress.update(len(chunk))
await progress.update(len(chunk))
progress.close()
await progress.close()
else:
log.error('⚠ 网络错误')
subprocess.run(str(out_path))
os.rmdir(temp_path)
else:
log.info('✅ 未使用SteamTools停止迁移')
log.info('✅ 未使用SteamTools停止迁移')