Update app.py
Browse files
app.py
CHANGED
|
@@ -90,20 +90,24 @@ def scrape_naver_blog(url):
|
|
| 90 |
|
| 91 |
return f"{output_title}\n\n{output_content}", final_debug_info
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
return f"{output_title}\n\n{output_content}", final_debug_info
|
| 92 |
|
| 93 |
+
except Exception as e:
|
| 94 |
+
# ์์ธ ๋ฐ์ ์ ์๋ฌ ๋ฉ์์ง์ ๋น ๋๋ฒ๊น
์ ๋ณด๋ฅผ ๋ฐํ
|
| 95 |
+
return f"An error occurred: {str(e)}", ""
|
| 96 |
+
|
| 97 |
+
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ (ํจ์ ๋ฐ์ ์์น)
|
| 98 |
+
title = "๋ค์ด๋ฒ ๋ธ๋ก๊ทธ ์คํฌ๋ํผ"
|
| 99 |
+
description = "๋ค์ด๋ฒ ๋ธ๋ก๊ทธ URL์ ์
๋ ฅํ๋ฉด ์ ๋ชฉ๊ณผ ๋ด์ฉ์ ์คํฌ๋ํํฉ๋๋ค."
|
| 100 |
+
|
| 101 |
+
iface = gr.Interface(
|
| 102 |
+
fn=scrape_naver_blog,
|
| 103 |
+
inputs=gr.Textbox(lines=2, placeholder="https://blog.naver.com/...", label="๋ธ๋ก๊ทธ URL"),
|
| 104 |
+
outputs=[
|
| 105 |
+
gr.Textbox(label="๊ฒฐ๊ณผ"),
|
| 106 |
+
gr.Textbox(label="๋๋ฒ๊น
์ ๋ณด")
|
| 107 |
+
],
|
| 108 |
+
title=title,
|
| 109 |
+
description=description,
|
| 110 |
+
allow_flagging="never"
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
iface.launch()
|