Update helper.py

This commit is contained in:
TheErrorExe 2025-04-01 21:38:18 +02:00 committed by GitHub
parent 630cbae7b0
commit b873c7fcc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@ import os
import subprocess import subprocess
import aiofiles import aiofiles
import aiohttp import aiohttp
import asyncio
async def read_file(path): async def read_file(path):
assert isinstance(path, str), "Path must be a string" assert isinstance(path, str), "Path must be a string"
@ -43,7 +44,7 @@ async def format_duration(seconds):
async def get_file_size(file_path): async def get_file_size(file_path):
try: try:
stat = os.stat(file_path) stat = await aiofiles.os.stat(file_path)
return stat.st_size return stat.st_size
except Exception as e: except Exception as e:
print(f"Error getting file size: {str(e)}") print(f"Error getting file size: {str(e)}")