bluenevus commited on
Commit
002ed93
·
verified ·
1 Parent(s): ecdf41d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -98,15 +98,11 @@ def transcribe_audio_chunks(chunks):
98
 
99
  def download_file(url):
100
  with requests.Session() as session:
101
- # First, send a HEAD request to get the final URL after redirects
102
- head_response = session.head(url, allow_redirects=True)
103
- final_url = head_response.url
104
  logger.info(f"Final URL after redirects: {final_url}")
105
 
106
- # Now, download from the final URL
107
- response = session.get(final_url, stream=True)
108
- response.raise_for_status()
109
-
110
  # Get the total file size
111
  total_size = int(response.headers.get('content-length', 0))
112
 
 
98
 
99
  def download_file(url):
100
  with requests.Session() as session:
101
+ # First, send a GET request to get the final URL after redirects
102
+ response = session.get(url, allow_redirects=True, stream=True)
103
+ final_url = response.url
104
  logger.info(f"Final URL after redirects: {final_url}")
105
 
 
 
 
 
106
  # Get the total file size
107
  total_size = int(response.headers.get('content-length', 0))
108