Update app.py
Browse files
app.py
CHANGED
@@ -131,14 +131,27 @@ def run_script(url: str, height: int, width: int, check_b,check_h):
|
|
131 |
return Image.open(f'{uid}-tmp.png'), mes,out_box,out
|
132 |
else:
|
133 |
return None, '<center>Please enter a valid URL of a website/host.',out_box,out
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
with gr.Blocks() as app:
|
137 |
|
138 |
with gr.Row():
|
139 |
with gr.Column():
|
140 |
inp = gr.Textbox(label="URL (must be Public)",lines=1)
|
141 |
-
|
|
|
|
|
142 |
|
143 |
with gr.Column():
|
144 |
check_h=gr.Checkbox(label="Show Header", value=True)
|
@@ -152,6 +165,7 @@ with gr.Blocks() as app:
|
|
152 |
out=gr.Image()
|
153 |
outgal=gr.Gallery()
|
154 |
outim = gr.Image()
|
155 |
-
|
|
|
156 |
btn.click(run_script,[inp,height,width,check_b,check_h],[outim,message,outgal,out])
|
157 |
app.queue(default_concurrency_limit=5).launch()
|
|
|
131 |
return Image.open(f'{uid}-tmp.png'), mes,out_box,out
|
132 |
else:
|
133 |
return None, '<center>Please enter a valid URL of a website/host.',out_box,out
|
134 |
+
def load_frame(inp):
|
135 |
+
html_mod=f"""
|
136 |
+
<div id="my_game" style="height:600px;width:100%">
|
137 |
+
<iframe
|
138 |
+
id="myIframe"
|
139 |
+
src="https://omnibus-snap.hf.space/?chat=[(123,555),(2342,32344)]&__theme=dark"
|
140 |
+
frameborder="0"
|
141 |
+
width="100%"
|
142 |
+
height="100%"
|
143 |
+
></iframe>
|
144 |
+
</div>"""
|
145 |
+
return html_mod
|
146 |
|
147 |
with gr.Blocks() as app:
|
148 |
|
149 |
with gr.Row():
|
150 |
with gr.Column():
|
151 |
inp = gr.Textbox(label="URL (must be Public)",lines=1)
|
152 |
+
with gr.Row():
|
153 |
+
load_btn=gr.Button("Load")
|
154 |
+
btn= gr.Button("Snapshot")
|
155 |
|
156 |
with gr.Column():
|
157 |
check_h=gr.Checkbox(label="Show Header", value=True)
|
|
|
165 |
out=gr.Image()
|
166 |
outgal=gr.Gallery()
|
167 |
outim = gr.Image()
|
168 |
+
prev=gr.HTML()
|
169 |
+
load_btn.click(load_frame,inp,prev)
|
170 |
btn.click(run_script,[inp,height,width,check_b,check_h],[outim,message,outgal,out])
|
171 |
app.queue(default_concurrency_limit=5).launch()
|