neuroama commited on
Commit
725f99f
·
1 Parent(s): 60c500c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -3,15 +3,14 @@ import requests
3
  import os
4
 
5
 
6
- try:
7
  response = requests.get(download_url)
8
  file_name = download_url.split("/")[-1] # Extracting the file name from the URL
9
  save_path = os.path.join(os.getcwd(), file_name)
10
  with open(save_path, 'wb') as f:
11
  f.write(response.content)
12
- return f"File downloaded successfully to {save_path}"
13
- except Exception as e:
14
- return f"Error downloading file: {str(e)}"
15
 
16
  def download_file(download_url):
17
  try:
 
3
  import os
4
 
5
 
6
+
7
  response = requests.get(download_url)
8
  file_name = download_url.split("/")[-1] # Extracting the file name from the URL
9
  save_path = os.path.join(os.getcwd(), file_name)
10
  with open(save_path, 'wb') as f:
11
  f.write(response.content)
12
+
13
+
 
14
 
15
  def download_file(download_url):
16
  try: