Spaces:
Running
Running
File size: 4,243 Bytes
dd7fe10 45a4d1c dd7fe10 0e61863 dd7fe10 1eb1070 c5d7fd8 1eb1070 45a4d1c dd7fe10 95323c2 3beaf26 95323c2 0e61863 31b503f 47e4bef dd7fe10 45a4d1c 0e61863 45a4d1c 3beaf26 45a4d1c 31b503f 1eb1070 3beaf26 31b503f e2f39d7 4bf567e 3beaf26 4bf567e 7445aa8 8350a52 1109c85 8b4a4bb 1109c85 224e62c 8350a52 2d3ad8c f508994 4c49e10 0ce2b97 b89c691 db2c6e6 1ae229c 6ab91d5 832e0de 2d4c981 f00a7d2 4a6a63d 09b2baf 54c1c69 0112ae2 ed2f6fc 8265f48 09b2baf 3beaf26 1e4a472 0e61863 f89ecf4 b6c04ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
import gradio as gr
import requests
import threading
import time
# ์ธ๋ถ URL์ ์ ์ํ๋ ํจ์๋ฅผ ์ ์ํฉ๋๋ค.
def check_connection(url):
try:
response = requests.get(url)
status = f"URL: {url} ์ํ ์ฝ๋: {response.status_code}, ์ ์ ์ํ: {'์ ์ ์ฑ๊ณต' if response.status_code == 200 else '์ ์ ์คํจ'}"
except Exception as e:
status = f"URL: {url} ์ ์ ์คํจ: {str(e)}"
print(status)
return status
# ํ์ด๋จธ๋ฅผ ์ฌ์ฉํ์ฌ ์ ํด์ง ์ฃผ๊ธฐ๋ก ํจ์๋ฅผ ๋ฐ๋ณต ์คํํฉ๋๋ค.
def start_timer(url, interval):
threading.Timer(interval, start_timer, [url, interval]).start()
check_connection(url)
# ํ์ด๋จธ ์์ ํจ์๋ฅผ Gradio์ ์
๋ ฅ๊ณผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
def setup_timer(interval, *urls):
interval_seconds = interval * 60 # ๋ถ์ ์ด๋ก ๋ณํ
for url in urls:
if url: # URL์ด ๋น์ด ์์ง ์์ผ๋ฉด ํ์ด๋จธ ์์
start_timer(url, interval_seconds)
return "ํ์ด๋จธ๊ฐ ์ค์ ๋์์ต๋๋ค."
# Gradio UI ์ปดํฌ๋ํธ๋ฅผ ์ ์ํฉ๋๋ค.
url_inputs = [gr.Text(label=f"URL {i+1}", placeholder=f"์ ์ํ URL {i+1}์ ์
๋ ฅํ์ธ์") for i in range(40)]
interval_input = gr.Slider(minimum=1, maximum=60, step=1, value=15, label="์ ์ ์ฃผ๊ธฐ(๋ถ)")
# Gradio ์ฑ ์ค์
app = gr.Interface(
fn=setup_timer,
inputs=[interval_input] + url_inputs,
outputs="text",
title="URL ์ ์ ์ฒด์ปค",
description="์ต๋ 40๊ฐ์ URL๊ณผ ์ ์ ์ฃผ๊ธฐ๋ฅผ ์
๋ ฅํ๊ณ '์์' ๋ฒํผ์ ํด๋ฆญํ์ธ์. ์ง์ ๋ ์ฃผ๊ธฐ๋ก HTTP ์ํ ์ฝ๋ ๋ฐ ์ ์ ์ํ๋ฅผ ํ์ธํฉ๋๋ค.",
examples=[
[
15,
"https://seawolf2357-timer4.hf.space",
"https://seawolf2357-timer.hf.space",
"https://seawolf2357-timer2.hf.space",
"https://fantaxy-timer1.hf.space",
"https://fantaxy-timer2.hf.space",
"https://seawolf2357-kai-pluting.hf.space",
"https://fantaxy-kai-flx-id.hf.space",
"https://seawolf2357-ofai-405.hf.space",#์ฌ๊ธฐ๋ถํฐ openfree.ai ์๋น์ค์ฉ ๋ฐฐ์น ์์
"https://fantaxy-ofai-70.hf.space",
"https://seawolf2357-ofai-8.hf.space",
"https://seawolf2357-ofai-Mistral-Nemo.hf.space",
"https://fantaxy-ofai-8x7b.hf.space",
"https://fantaxy-ofai-phi.hf.space",
"https://fantaxy-ofai-Yi.hf.space",
"https://fantaxy-ofai-mis7b.hf.space",
"https://fantaxy-ofai-kai.hf.space",
# "https://fantaxy-ofai-flx-expl-notio.hf.space",
"https://fantaxy-ofai-it2v2.hf.space",
"https://fantaxy-ofai-flx-expl-store.hf.space",
"https://fantaxy-ofai-t2v.hf.space",
"https://ginipick-FLUX-Prompt-Generator.hf.space",
"https://ginipick-VidiQA.hf.space",
"https://ginipick-finegrain-image-enhancer.hf.space",
"https://ginipick-background-removal.hf.space",
"https://fantaxy-playground25.hf.space",
"https://fantaxy-Stable-Audio-Open-Zero.hf.space",
"https://fantaxy-Remove-Video-Background.hf.space",
"https://fantaxy-AuroFlow-v3.hf.space",
"https://ginipick-stable-fast-3d.hf.space",
"https://fantaxy-Kolors-IPAdapter.hf.space",
"https://ginipick-Phi-35-vision.hf.space",
"https://seawolf2357-whiwebgpu.hf.space",
"https://ginipick-ofai-flxnf4.hf.space",
# "https://ginipick-AccDiffusion.hf.space",
"https://seawolf2357-jinjavis.hf.space",
"https://seawolf2357-jinjavis-chat-api.hf.space",
"https://seawolf2357-jinjavis-blog-api.hf.space",
"https://seawolf2357-jinjavis-blog-medi.hf.space",
"https://seawolf2357-jinjavis-blog-pharm.hf.space",
"https://seawolf2357-ofai-jinjavis-blog.hf.space",
"https://seawolf2357-ofai-jinjavis-blog-medi.hf.space",
"https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space"
]
],
cache_examples=False # ์บ์ ๋นํ์ฑํ
)
app.launch()
|