Update app.py
Browse files
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
|
| 102 |
-
|
| 103 |
-
final_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 |
|