File size: 4,216 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
0b40312
4bf567e
3beaf26
4bf567e
 
0b40312
 
 
 
0833ebb
 
3aa8dad
a98b307
0491fcc
9e74710
 
06c49b1
fe1defe
 
 
f373cf0
ff0eba0
 
 
 
1bdb6ed
6c2331d
04c45f3
4c3e5a8
375db34
131ed56
04c45f3
1ae229c
6ab91d5
832e0de
 
2d4c981
f00a7d2
4a6a63d
08f1764
54c1c69
0112ae2
ed2f6fc
8265f48
1bdb6ed
ff0eba0
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
95
96
97
98
99
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-timer3.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-flx.hf.space",
            "https://aiqtech-FLUX-Ghibli-Studio-LoRA.hf.space", 
            "https://aiqtech-flxani.hf.space",
            "https://aiqtech-flxgif.hf.space",
            "https://ginipick-ofai-flxnf4.hf.space",
            "https://ginipick-AccDiffusion.hf.space",
            "https://fantaxy-ofai-flx-logo.hf.space",
            "https://fantos-EveryText.hf.space",
            "https://aiqtech-Phi35-Vision.hf.space",
            "https://aiqtech-kofaceid.hf.space",    
            "https://aiqtech-producbrmg.hf.space",
            "https://seawolf2357-bnews1.hf.space",
            "https://fantos-flx8lora.hf.space",
            "https://fantos-cogvidx.hf.space",
            "https://fantos-flxcontrol.hf.space",
            "https://fantos-flxfashmodel.hf.space",
            "https://aiqtech-cinevid.hf.space",
            
            "https://seawolf2357-kai-image-sdxl.hf.space", 
            "https://seawolf2357-kai-flx.hf.space", 
            "https://seawolf2357-RealVisXL5.hf.space",             
            
            "https://fantaxy-blogger-send-webhook-confirm-image.hf.space",
            "https://fantaxy-blogger-send-webhook-auto-image.hf.space",
            "https://seawolf2357-bnews2.hf.space",
            "https://seawolf2357-bnews3.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-medi.hf.space",   
            "https://seawolf2357-jinjavis-blog-pharm.hf.space",


            "https://seawolf2357-ofai-jinjavis-blog-medi.hf.space",   
            "https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space"            
    
        ]
    ],
    cache_examples=False  # ์บ์‹œ ๋น„ํ™œ์„ฑํ™”
)
app.launch()