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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -51,7 +51,7 @@ def save_webpage_as_zip(url):
51
  asset_full_path = os.path.join(temp_dir, asset_path)
52
 
53
  # Skip if asset_path is a directory
54
- if os.path.isdir(asset_full_path):
55
  print(f"Skipping directory {asset_full_path}")
56
  continue
57
 
@@ -84,7 +84,10 @@ def save_webpage_as_zip(url):
84
  def generate_zip_file(url):
85
  """Generate ZIP file from a webpage URL."""
86
  zip_buffer = save_webpage_as_zip(url)
87
- return zip_buffer, 'webpage.zip'
 
 
 
88
 
89
  # Gradio Interface
90
  with gr.Blocks() as demo:
 
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
57
 
 
84
  def generate_zip_file(url):
85
  """Generate ZIP file from a webpage URL."""
86
  zip_buffer = save_webpage_as_zip(url)
87
+ temp_zip_path = "webpage.zip"
88
+ with open(temp_zip_path, 'wb') as f:
89
+ f.write(zip_buffer.read())
90
+ return temp_zip_path
91
 
92
  # Gradio Interface
93
  with gr.Blocks() as demo: