MariaKaiser commited on
Commit
4ee781d
·
verified ·
1 Parent(s): 64b8e6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -111,13 +111,14 @@ async def download_file_from_url(url: str) -> str | None:
111
  """
112
  try:
113
  async with httpx.AsyncClient() as client:
114
- response = await client.get(url, timeout=30.0) # optional timeout
115
  response.raise_for_status() # raises for non-200 status codes
116
 
117
  # Save to a temporary file
118
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".wav")
119
  temp_file.write(response.content)
120
  temp_file.close()
 
121
  return temp_file.name
122
 
123
  except Exception as e:
 
111
  """
112
  try:
113
  async with httpx.AsyncClient() as client:
114
+ response = await client.get(url, timeout=60.0) # optional timeout
115
  response.raise_for_status() # raises for non-200 status codes
116
 
117
  # Save to a temporary file
118
  temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".wav")
119
  temp_file.write(response.content)
120
  temp_file.close()
121
+ print(f"downloaded {url} successfully")
122
  return temp_file.name
123
 
124
  except Exception as e: