Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from bs4 import BeautifulSoup
|
3 |
+
import requests
|
4 |
|
5 |
+
HEADER = {
|
6 |
+
"User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
|
7 |
+
}
|
8 |
+
link = "https://www.youtube.com/watch?v=qZp5gf9xgnE"
|
9 |
+
def greet(link):
|
10 |
+
response = requests.get(link, headers=HEADER)
|
11 |
+
soup = BeautifulSoup(response.text, "html.parser")
|
12 |
+
return "Hello " + soup.prettify() + "!!"
|
13 |
|
14 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
iface.launch()
|