Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,13 @@ def transcribe_audio_chunks(chunks):
|
|
| 98 |
|
| 99 |
def download_file(url):
|
| 100 |
with requests.Session() as session:
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
response.raise_for_status()
|
| 103 |
|
| 104 |
# Get the total file size
|
|
|
|
| 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
|