File size: 5,348 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
721b4b5
 
 
 
 
a08a9ab
 
 
 
 
 
 
 
 
 
721b4b5
3aa8dad
a98b307
0491fcc
9e74710
 
06c49b1
fe1defe
 
 
f373cf0
6c2331d
 
04c45f3
4c3e5a8
375db34
131ed56
04c45f3
1ae229c
6ab91d5
832e0de
 
2d4c981
f00a7d2
4a6a63d
08f1764
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
95
96
97
98
99
100
101
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-timer-new2.hf.space",
            
            "https://seawolf2357-kai-imgsearch.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-사진 검색-채널: 1254293946679431218
            "https://seawolf2357-kai-vidsearch.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-λΉ„λ””μ˜€ 검색-채널: 1254294089449341061            
            "https://fantaxy-kai-llm-trans.hf.space",     #λ””μŠ€μ½”λ“œ-openfreeai-110개 μ–Έμ–΄ λ²ˆμ—­-채널: 1252511288450351134
            "https://fantaxy-kai-llm-chat.hf.space",        #λ””μŠ€μ½”λ“œ-openfreeai-kai 챗봇-채널: 1228393183700844687
            "https://fantaxy-kai-llm-chat-speech.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-kai 챗봇 μŒμ„±-채널: 1254268258580959282
            "https://seawolf2357-kai-llm-search.hf.space",  #λ””μŠ€μ½”λ“œ-openfreeai-kai μ„œμΉ˜ gpt-채널: 1267341708165910559
            "https://seawolf2357-kai-llm-medi.hf.space",    #λ””μŠ€μ½”λ“œ-openfreeai-kai μ˜ν•™-채널: 1266268642278899753
            "https://seawolf2357-kai-llm-pharm.hf.space",   #λ””μŠ€μ½”λ“œ-openfreeai-kai 약리학-채널: 1266295375199998026
            "https://seawolf2357-kai-llm-insu.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-kai μ’…ν•©λ³΄ν—˜-채널: 1266960452517232722
            "https://seawolf2357-kai-llm-medi.hf.space",    #λ””μŠ€μ½”λ“œ-openfreeai-kai 페λ₯΄μ†Œλ‚˜-채널: 1262218748044247192
            "https://seawolf2357-kai-llm-pharm.hf.space",   #λ””μŠ€μ½”λ“œ-openfreeai-kai λΈ”λ‘œκ·Έ-채널: 1252068313023123526
            "https://seawolf2357-kai-llm-insu.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-kai μ†Œ-채널: 1260158278000971849          
            "https://ginipick-kai-llm-law1.hf.space", #λ””μŠ€μ½”λ“œ-openfreeai-kai 법λ₯  1-채널: 1252828517247221770
            
            "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://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-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()