memex-in commited on
Commit
5951131
·
verified ·
1 Parent(s): 9cdc5ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -39,10 +39,10 @@ if st.button("Generate ASCII Screenshot"):
39
  try:
40
  screenshot_file = "screenshot.png"
41
  st.write("Capturing website screenshot...")
42
- capture_screenshot(url, screenshot_file)
43
 
44
  st.write("Converting to ASCII art...")
45
- ascii_output = AsciiArt.from_image(screenshot_file)
46
 
47
  # Display ASCII art in a text area
48
  st.text_area("ASCII Art Output", ascii_output, height=600)
@@ -52,4 +52,4 @@ if st.button("Generate ASCII Screenshot"):
52
  finally:
53
  # Clean up the screenshot file if it exists
54
  if os.path.exists(screenshot_file):
55
- os.remove(screenshot_file)
 
39
  try:
40
  screenshot_file = "screenshot.png"
41
  st.write("Capturing website screenshot...")
42
+ capture_screenshot(url.strip('"')) # Strip any extra quotes from the URL
43
 
44
  st.write("Converting to ASCII art...")
45
+ ascii_output = convert_to_ascii(screenshot_file) # Use the correct function
46
 
47
  # Display ASCII art in a text area
48
  st.text_area("ASCII Art Output", ascii_output, height=600)
 
52
  finally:
53
  # Clean up the screenshot file if it exists
54
  if os.path.exists(screenshot_file):
55
+ os.remove(screenshot_file)