prithivMLmods commited on
Commit
7b9c6c2
·
verified ·
1 Parent(s): 4d8ba20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -50,7 +50,7 @@ def save_webpage_as_zip(url):
50
  asset_path = urlparse(asset_url).path.lstrip('/')
51
  asset_full_path = os.path.join(temp_dir, asset_path)
52
 
53
- # Skip if asset_path is a directory
54
  if asset_path.endswith('/'):
55
  print(f"Skipping directory {asset_full_path}")
56
  continue
@@ -61,6 +61,9 @@ def save_webpage_as_zip(url):
61
  # Download and save the asset
62
  content = download_file(asset_url, session)
63
  if content:
 
 
 
64
  with open(asset_full_path, 'wb') as f:
65
  f.write(content)
66
 
 
50
  asset_path = urlparse(asset_url).path.lstrip('/')
51
  asset_full_path = os.path.join(temp_dir, asset_path)
52
 
53
+ # Skip if asset_full_path is a directory
54
  if asset_path.endswith('/'):
55
  print(f"Skipping directory {asset_full_path}")
56
  continue
 
61
  # Download and save the asset
62
  content = download_file(asset_url, session)
63
  if content:
64
+ if os.path.isdir(asset_full_path):
65
+ print(f"Skipping directory {asset_full_path}")
66
+ continue
67
  with open(asset_full_path, 'wb') as f:
68
  f.write(content)
69