Update app.py
Browse files
app.py
CHANGED
@@ -1,2 +1,385 @@
|
|
1 |
-
import
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import logging
|
4 |
+
import datetime
|
5 |
+
import threading
|
6 |
+
import time
|
7 |
+
from pytz import timezone
|
8 |
+
from collections import defaultdict
|
9 |
+
|
10 |
+
logging.basicConfig(level=logging.INFO)
|
11 |
+
|
12 |
+
# λ‘κ·ΈμΈ μΈμ¦ μ 보
|
13 |
+
VALID_USERNAME = "ets2020"
|
14 |
+
VALID_PASSWORD = "1089"
|
15 |
+
|
16 |
+
# λ‘κ·ΈμΈ μν κ΄λ¦¬
|
17 |
+
is_logged_in = False
|
18 |
+
|
19 |
+
# λ‘κ·Έμμ μ²λ¦¬ ν¨μ
|
20 |
+
def process_logout():
|
21 |
+
global is_logged_in
|
22 |
+
is_logged_in = False
|
23 |
+
return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False), None
|
24 |
+
|
25 |
+
# μμ΄λλ³ μ΄λ©μΌ λ° λΉλ°λ²νΈ μ 보 (μ€μ λ°°ν¬ μμλ 보μμ μν΄ λ€λ₯Έ λ°©μμΌλ‘ κ΄λ¦¬νλ κ²μ΄ μ’μ΅λλ€)
|
26 |
+
CREDENTIALS = {
|
27 |
+
"whispersound": ["*****", "*****"],
|
28 |
+
"happydoggg": ["*****", "*****"],
|
29 |
+
"magictreee": ["*****", "*****"],
|
30 |
+
"fastcarr": ["*****", "*****"],
|
31 |
+
"corpcorp1": ["*****", "*****"],
|
32 |
+
"rara527": ["*****", "*****"],
|
33 |
+
"bluskyyy": ["*****", "*****"],
|
34 |
+
"ssboost": ["*****", "*****"],
|
35 |
+
"ekdhstldhs": ["*****", "*****"],
|
36 |
+
}
|
37 |
+
|
38 |
+
# μλΉμ€ λͺ©λ‘
|
39 |
+
TARGETS = [
|
40 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°+μν건κ°", "url": "https://huggingface.co/spaces/whispersound/kmkm_1-1"},
|
41 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/whispersound/kmkm_2-1"},
|
42 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/whispersound/kmkm_3-1"},
|
43 |
+
{"name": "μλλΈλ‘κ·Έ-ν΅μ¬κΈ°λ₯", "url": "https://huggingface.co/spaces/whispersound/kmkm_4-1"},
|
44 |
+
{"name": "μλλΈλ‘κ·Έ-λ°©λ¬ΈνκΈ°", "url": "https://huggingface.co/spaces/whispersound/kmkm_5-1"},
|
45 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°", "url": "https://huggingface.co/spaces/whispersound/mmmha_1-1"},
|
46 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/whispersound/mmmha_2-1"},
|
47 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/whispersound/mmmha_3-1"},
|
48 |
+
{"name": "μ νλΈ-μμ½", "url": "https://huggingface.co/spaces/whispersound/ybyb-r-1"},
|
49 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μΌλ°)", "url": "https://huggingface.co/spaces/whispersound/ybyb_1-1"},
|
50 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν건κ°)", "url": "https://huggingface.co/spaces/whispersound/ybyb_1-2-1"},
|
51 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μ¬ν)", "url": "https://huggingface.co/spaces/whispersound/ybyb_2-1"},
|
52 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν리뷰)", "url": "https://huggingface.co/spaces/whispersound/ybyb_3-1"},
|
53 |
+
{"name": "μ΄μ»€λ¨Έμ€-μΉ΄νΌλΌμ΄ν
", "url": "https://huggingface.co/spaces/whispersound/LuLu_cp_1_R-1"},
|
54 |
+
{"name": "μ΄μ»€λ¨Έ-μμΈνμ΄μ§κΈ°ν", "url": "https://huggingface.co/spaces/whispersound/plpl_1-1"},
|
55 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°+μν건κ°(μ ν΄μ©)", "url": "https://huggingface.co/spaces/whispersound/kmkm_1-4"},
|
56 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰(μ ν΄μ©)", "url": "https://huggingface.co/spaces/whispersound/kmkm_3-4"},
|
57 |
+
{"name": "μλλΈλ‘κ·Έ-ν΅μ¬κΈ°λ₯(μ ν΄μ©)", "url": "https://huggingface.co/spaces/whispersound/kmkm_4-4"},
|
58 |
+
|
59 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/fastcarr/ldleeer1-1"},
|
60 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/fastcarr/lleryr1-1"},
|
61 |
+
{"name": "컨νΈλ‘€-μ νλΈ", "url": "https://huggingface.co/spaces/fastcarr/kketywe1-1"},
|
62 |
+
{"name": "컨νΈλ‘€-μΉ΄νΌμμΈ", "url": "https://huggingface.co/spaces/fastcarr/euywe1-1"},
|
63 |
+
{"name": "κΈ°λ₯-리뷰λΆμ", "url": "https://huggingface.co/spaces/fastcarr/vvvpppp_1-1"},
|
64 |
+
{"name": "κΈ°λ₯-λΈλ‘κ·Έν¬λ‘€λ¬", "url": "https://huggingface.co/spaces/fastcarr/ttpp323-1"},
|
65 |
+
{"name": "κΈ°λ₯-μ νλΈλλ³ΈμΆμΆκΈ°", "url": "https://huggingface.co/spaces/fastcarr/YT_Ts_R-1"},
|
66 |
+
{"name": "κΈ°λ₯-PDFμμ±κΈ°", "url": "https://huggingface.co/spaces/fastcarr/gaewate1-1"},
|
67 |
+
{"name": "κΈ°λ₯-λΈλ‘κ·Έν¬λ‘€λ¬(μ ν΄μ©)", "url": "https://huggingface.co/spaces/fastcarr/ttpp323-4"},
|
68 |
+
{"name": "κΈ°λ₯-μ νλΈλλ³ΈμΆμΆκΈ°(μ ν΄μ©)", "url": "https://huggingface.co/spaces/fastcarr/YT_Ts_R-4"},
|
69 |
+
|
70 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°+μν건κ°", "url": "https://huggingface.co/spaces/happydoggg/kmkm_1-2"},
|
71 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/happydoggg/kmkm_2-2"},
|
72 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/happydoggg/kmkm_3-2"},
|
73 |
+
{"name": "μλλΈλ‘κ·Έ-ν΅μ¬κΈ°λ₯", "url": "https://huggingface.co/spaces/happydoggg/kmkm_4-2"},
|
74 |
+
{"name": "μλλΈλ‘κ·Έ-λ°©λ¬ΈνκΈ°", "url": "https://huggingface.co/spaces/happydoggg/kmkm_5-2"},
|
75 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°", "url": "https://huggingface.co/spaces/happydoggg/mmmha_1-2"},
|
76 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/happydoggg/mmmha_2-2"},
|
77 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/happydoggg/mmmha_3-2"},
|
78 |
+
{"name": "μ νλΈ-μμ½", "url": "https://huggingface.co/spaces/happydoggg/ybyb-r-2"},
|
79 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μΌλ°)", "url": "https://huggingface.co/spaces/happydoggg/ybyb_1-2"},
|
80 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν건κ°)", "url": "https://huggingface.co/spaces/happydoggg/ybyb_1-2-2"},
|
81 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μ¬ν)", "url": "https://huggingface.co/spaces/happydoggg/ybyb_2-2"},
|
82 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν리뷰)", "url": "https://huggingface.co/spaces/happydoggg/ybyb_3-2"},
|
83 |
+
{"name": "μ΄μ»€λ¨Έμ€-μΉ΄νΌλΌμ΄ν
", "url": "https://huggingface.co/spaces/happydoggg/LuLu_cp_1_R-2"},
|
84 |
+
{"name": "μ΄μ»€λ¨Έμ€-μμΈνμ΄μ§κΈ°ν", "url": "https://huggingface.co/spaces/happydoggg/plpl_1-2"},
|
85 |
+
|
86 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/corpcorp1/ldleeer1-2"},
|
87 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/corpcorp1/lleryr1-2"},
|
88 |
+
{"name": "컨νΈλ‘€-μ νλΈ", "url": "https://huggingface.co/spaces/corpcorp1/kketywe1-2"},
|
89 |
+
{"name": "컨νΈλ‘€-μΉ΄νΌμμΈ", "url": "https://huggingface.co/spaces/corpcorp1/euywe1-2"},
|
90 |
+
{"name": "κΈ°λ₯-리뷰λΆμ", "url": "https://huggingface.co/spaces/corpcorp1/vvvpppp_1-2"},
|
91 |
+
{"name": "κΈ°λ₯-λΈλ‘κ·Έν¬λ‘€λ¬", "url": "https://huggingface.co/spaces/corpcorp1/ttpp323-2"},
|
92 |
+
{"name": "κΈ°λ₯-μ νλΈλλ³ΈμΆμΆκΈ°", "url": "https://huggingface.co/spaces/corpcorp1/YT_Ts_R-2"},
|
93 |
+
{"name": "κΈ°λ₯-PDFμμ±κΈ°", "url": "https://huggingface.co/spaces/corpcorp1/gaewate1-2"},
|
94 |
+
|
95 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°+μν건κ°", "url": "https://huggingface.co/spaces/magictreee/kmkm_1-3"},
|
96 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/magictreee/kmkm_2-3"},
|
97 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/magictreee/kmkm_3-3"},
|
98 |
+
{"name": "μλλΈλ‘κ·Έ-ν΅μ¬κΈ°λ₯", "url": "https://huggingface.co/spaces/magictreee/kmkm_4-3"},
|
99 |
+
{"name": "μλλΈλ‘κ·Έ-λ°©λ¬ΈνκΈ°", "url": "https://huggingface.co/spaces/magictreee/kmkm_5-3"},
|
100 |
+
{"name": "μλλΈλ‘κ·Έ-μΌλ°", "url": "https://huggingface.co/spaces/magictreee/mmmha_1-3"},
|
101 |
+
{"name": "μλλΈλ‘κ·Έ-μ¬ν", "url": "https://huggingface.co/spaces/magictreee/mmmha_2-3"},
|
102 |
+
{"name": "μλλΈλ‘κ·Έ-μν리뷰", "url": "https://huggingface.co/spaces/magictreee/mmmha_3-3"},
|
103 |
+
{"name": "μ νλΈ-μμ½", "url": "https://huggingface.co/spaces/magictreee/ybyb-r-3"},
|
104 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μΌλ°)", "url": "https://huggingface.co/spaces/magictreee/ybyb_1-3"},
|
105 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν건κ°)", "url": "https://huggingface.co/spaces/magictreee/ybyb_1-2-3"},
|
106 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μ¬ν)", "url": "https://huggingface.co/spaces/magictreee/ybyb_2-3"},
|
107 |
+
{"name": "μ νλΈ-λΈλ‘κ·Έ(μν리뷰)", "url": "https://huggingface.co/spaces/magictreee/ybyb_3-3"},
|
108 |
+
{"name": "μ΄μ»€λ¨Έμ€-μΉ΄νΌλΌμ΄ν
", "url": "https://huggingface.co/spaces/magictreee/LuLu_cp_1_R-3"},
|
109 |
+
{"name": "μ΄μ»€λ¨Έμ€-μμΈνμ΄μ§κΈ°ν", "url": "https://huggingface.co/spaces/magictreee/plpl_1-3"},
|
110 |
+
|
111 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/rara527/ldleeer1-3"},
|
112 |
+
{"name": "컨νΈλ‘€-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/rara527/lleryr1-3"},
|
113 |
+
{"name": "컨νΈλ‘€-μ νλΈ", "url": "https://huggingface.co/spaces/rara527/kketywe1-3"},
|
114 |
+
{"name": "컨νΈλ‘€-μΉ΄νΌμμΈ", "url": "https://huggingface.co/spaces/rara527/euywe1-3"},
|
115 |
+
{"name": "κΈ°λ₯-리뷰λΆμ", "url": "https://huggingface.co/spaces/rara527/vvvpppp_1-3"},
|
116 |
+
{"name": "κΈ°λ₯-λΈλ‘κ·Έν¬λ‘€λ¬", "url": "https://huggingface.co/spaces/rara527/ttpp323-3"},
|
117 |
+
{"name": "κΈ°λ₯-μ νλΈλλ³ΈμΆμΆκΈ°", "url": "https://huggingface.co/spaces/rara527/YT_Ts_R-3"},
|
118 |
+
{"name": "κΈ°λ₯-PDFμμ±κΈ°", "url": "https://huggingface.co/spaces/rara527/gaewate1-3"},
|
119 |
+
|
120 |
+
{"name": "λ©μΈκΈ°λ₯-μνλ°°κ²½μ΄λ―Έμ§", "url": "https://huggingface.co/spaces/bluskyyy/asvdqw3g234"},
|
121 |
+
{"name": "λ©μΈκΈ°λ₯-리뷰λΆμ", "url": "https://huggingface.co/spaces/bluskyyy/4234g5hhs"},
|
122 |
+
{"name": "λ©μΈκΈ°λ₯-μ΄λ―Έμ§μμ±κΈ°", "url": "https://huggingface.co/spaces/bluskyyy/asdfqwe"},
|
123 |
+
{"name": "λ©μΈκΈ°λ₯-λΈλ‘κ·Έν¬μ€ν
", "url": "https://huggingface.co/spaces/bluskyyy/33f23f3f-3"},
|
124 |
+
|
125 |
+
{"name": "μ΄λ―Έμ§-λ°°κ²½μ κ±°", "url": "https://huggingface.co/spaces/ssboost/B_G"},
|
126 |
+
{"name": "μ΄λ―Έμ§-νμ§κ°μ κΈ°", "url": "https://huggingface.co/spaces/ssboost/Up_G"},
|
127 |
+
{"name": "μ΄λ―Έμ§-ModelSwap", "url": "https://huggingface.co/spaces/ssboost/ModelSwap-1"},
|
128 |
+
{"name": "μ΄λ―Έμ§-νν°", "url": "https://huggingface.co/spaces/ssboost/Image_Filter-1"},
|
129 |
+
{"name": "μ΄λ―Έμ§-볡μ", "url": "https://huggingface.co/spaces/ssboost/old_restoration-1"},
|
130 |
+
{"name": "μ΄λ―Έμ§-μ΄μ»€λ¨Έμ€AIμ΄λ―Έμ§μμ±", "url": "https://huggingface.co/spaces/ssboost/6hjw3hs3"},
|
131 |
+
{"name": "μ΄λ―Έμ§-λ°°κ²½μμ±κΈ°", "url": "https://huggingface.co/spaces/ssboost/g7yhw43gssdf"},
|
132 |
+
{"name": "μ΄λ―ΈοΏ½οΏ½-λ°°κ²½μμ±κΈ°(μμ)", "url": "https://huggingface.co/spaces/ssboost/asdfewef"},
|
133 |
+
{"name": "μ΄λ―Έμ§-λ°°κ²½μμ±κΈ°(μ )", "url": "https://huggingface.co/spaces/ssboost/veegsd"},
|
134 |
+
{"name": "μ΄λ―Έμ§-λΈλ‘κ·Έμ΄λ―Έμ§μ", "url": "https://huggingface.co/spaces/ssboost/dfq23d"},
|
135 |
+
{"name": "μ΄λ―Έμ§-μ΄λ―Έμ§νΈμ§", "url": "https://huggingface.co/spaces/ssboost/swq2f"},
|
136 |
+
{"name": "μ΄μ»€λ¨Έμ€-리뷰λΆμ", "url": "https://huggingface.co/spaces/ssboost/fe2fsd"},
|
137 |
+
{"name": "μ΄μ»€λ¨Έμ€-λ€μ΄λ²μΌνμνλͺ
λΆμ", "url": "https://huggingface.co/spaces/ssboost/d34feer"},
|
138 |
+
{"name": "μ μ©νν΄-κΈλ€λ¬", "url": "https://huggingface.co/spaces/ssboost/E2T4TWEWEWE"},
|
139 |
+
{"name": "μ μ©νν΄-μ
λ¬ μλ λ²μκΈ°", "url": "https://huggingface.co/spaces/ssboost/G378DFE4AS"},
|
140 |
+
{"name": "μ μ©νν΄-gif", "url": "https://huggingface.co/spaces/ssboost/gif-1"},
|
141 |
+
{"name": "μ μ©νν΄-μ μ¬λ°©μ§μ΄λ―Έμ§λ³νκΈ°", "url": "https://huggingface.co/spaces/ssboost/N_I"},
|
142 |
+
{"name": "μ μ©νν΄-λΈλ‘κ·ΈννμλΆμ", "url": "https://huggingface.co/spaces/ssboost/ge3gsdgas"},
|
143 |
+
{"name": "κΈμ°κΈ°-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/ssboost/EWV2DDWEE"},
|
144 |
+
{"name": "κΈμ°κΈ°-μλλΈλ‘κ·Έ", "url": "https://huggingface.co/spaces/ssboost/G3YGSDE"},
|
145 |
+
{"name": "κΈμ°κΈ°-μ νλΈ", "url": "https://huggingface.co/spaces/ssboost/FVW3GSX3"},
|
146 |
+
{"name": "μ΄μ»€λ¨Έμ€-μνλͺ
(λ©μΈν€μλ)", "url": "https://huggingface.co/spaces/ssboost/F23ASFGGD"},
|
147 |
+
{"name": "μ΄μ»€λ¨Έμ€-μνλͺ
(μνλͺ
λΆμ)", "url": "https://huggingface.co/spaces/ssboost/F23ASFGGD-2"},
|
148 |
+
{"name": "μ΄μ»€λ¨Έμ€-μμ±λΆμκΈ°(νλ²μ )", "url": "https://huggingface.co/spaces/ssboost/3gghdf5"},
|
149 |
+
{"name": "μ΄μ»€λ¨Έμ€-μμ±λΆμκΈ°(κ°λ΅ν)", "url": "https://huggingface.co/spaces/ssboost/geo5g4gfj"},
|
150 |
+
{"name": "μ΄λ―Έμ§-κΈμμ§μ°κΈ°", "url": "https://huggingface.co/spaces/ssboost/hkpdejhed"},
|
151 |
+
{"name": "μ΄λ―Έμ§-μ΄λ―Έμ§λ°κΎΈκΈ°", "url": "https://huggingface.co/spaces/ssboost/g94h4jd"},
|
152 |
+
|
153 |
+
|
154 |
+
{"name": "λ©μΈνμ΄μ§-리뷰λΆμ", "url": "https://huggingface.co/spaces/ekdhstldhs/86f86f80yg"},
|
155 |
+
{"name": "λ©μΈνμ΄μ§-λΈλ‘κ·Έμμ±", "url": "https://huggingface.co/spaces/ekdhstldhs/f23fewde"},
|
156 |
+
{"name": "λ©μΈνμ΄μ§-μμ±λΆμκΈ°(νλ²μ )", "url": "https://huggingface.co/spaces/ekdhstldhs/f232fwe"},
|
157 |
+
{"name": "λ©μΈνμ΄μ§-μμ±λΆμκΈ°(κ°λ΅ν)", "url": "https://huggingface.co/spaces/ekdhstldhs/df2wwewe"},
|
158 |
+
{"name": "λ©μΈνμ΄μ§-μΈλ€μΌλ°°κ²½λ°κΎΈκΈ°", "url": "https://huggingface.co/spaces/ekdhstldhs/fsqwgvdsd"},
|
159 |
+
{"name": "λ©μΈνμ΄μ§-μ΄λ―Έμ§μμ±", "url": "https://huggingface.co/spaces/ekdhstldhs/g34ysdv234g"},
|
160 |
+
{"name": "κΈ°νκΈ°λ₯-λ°°κ²½μ§μ°κΈ°", "url": "https://huggingface.co/spaces/ekdhstldhs/df2wedds"},
|
161 |
+
{"name": "κΈ°νκΈ°λ₯-νμ§κ°μ κΈ°", "url": "https://huggingface.co/spaces/ekdhstldhs/fef232fsdes"},
|
162 |
+
{"name": "보쑰기λ₯-λΈλ‘κ·Έ(μν리뷰)", "url": "https://huggingface.co/spaces/ekdhstldhs/kkie2"},
|
163 |
+
{"name": "보쑰기λ₯-λΈλ‘κ·Έ(ν΅μ¬κΈ°λ₯)", "url": "https://huggingface.co/spaces/ekdhstldhs/kkie3"}
|
164 |
+
|
165 |
+
]
|
166 |
+
|
167 |
+
KST = timezone('Asia/Seoul')
|
168 |
+
|
169 |
+
# λ‘κ·ΈμΈ μ²λ¦¬ ν¨μ
|
170 |
+
def process_login(username, password):
|
171 |
+
global is_logged_in
|
172 |
+
if username == VALID_USERNAME and password == VALID_PASSWORD:
|
173 |
+
is_logged_in = True
|
174 |
+
dashboard_html = update_dashboard() # λμ보λ λ°μ΄ν° λ‘λ
|
175 |
+
return gr.update(visible=False), gr.update(visible=True), "λ‘κ·ΈμΈ μ±κ³΅! λμ보λλ‘ μ΄λν©λλ€.", dashboard_html
|
176 |
+
else:
|
177 |
+
return gr.update(visible=True), gr.update(visible=False), "μμ΄λ λλ λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€.", None
|
178 |
+
|
179 |
+
# URL μν μ²΄ν¬ ν¨μ - κ°μ λ λ²μ
|
180 |
+
def check_url_status(url):
|
181 |
+
try:
|
182 |
+
response = requests.get(url, timeout=5)
|
183 |
+
response_text = response.text.lower()
|
184 |
+
|
185 |
+
# νμ΄μ§κ° μΌμμ€μ§λ κ²½μ°μ λͺ
νν νμ νμΈ
|
186 |
+
if "paused by its owner" in response_text or "this space has been paused" in response_text:
|
187 |
+
return "Paused"
|
188 |
+
|
189 |
+
# μλ΅ μ½λ νμΈ
|
190 |
+
if response.status_code == 200:
|
191 |
+
# 200 OKμ΄μ§λ§ λ΄μ©μ μ€λ₯ ν€μλκ° μλμ§ νμΈ
|
192 |
+
error_keywords = ["runtime error", "no application file", "build error",
|
193 |
+
"configuration error", "error", "failed"]
|
194 |
+
for keyword in error_keywords:
|
195 |
+
if keyword in response_text:
|
196 |
+
return "μ€λ₯"
|
197 |
+
|
198 |
+
# λ€λ₯Έ μν ν€μλλ νμΈ
|
199 |
+
if "paused" in response_text:
|
200 |
+
return "Paused"
|
201 |
+
elif "sleeping" in response_text or "asleep" in response_text:
|
202 |
+
return "Sleeping"
|
203 |
+
elif "building" in response_text:
|
204 |
+
return "Building"
|
205 |
+
elif "restarting" in response_text:
|
206 |
+
return "Restarting"
|
207 |
+
elif "starting" in response_text:
|
208 |
+
return "Starting"
|
209 |
+
|
210 |
+
# μ μ μ€ν μ€
|
211 |
+
return "Running"
|
212 |
+
|
213 |
+
elif response.status_code == 503:
|
214 |
+
return "Sleeping" # 503μ μΌλ°μ μΌλ‘ sleeping μν
|
215 |
+
elif response.status_code >= 400:
|
216 |
+
return "μ€λ₯" # 400λ, 500λ μ½λλ μ€λ₯
|
217 |
+
|
218 |
+
# κΈ°λ³Έκ°
|
219 |
+
return "μν λΆλͺ
"
|
220 |
+
|
221 |
+
except requests.exceptions.Timeout:
|
222 |
+
return "νμμμ"
|
223 |
+
except requests.exceptions.ConnectionError:
|
224 |
+
return "μ°κ²° μ€λ₯"
|
225 |
+
except Exception as e:
|
226 |
+
logging.error(f"URL μ²΄ν¬ μ€ μ€λ₯ λ°μ: {url}, {str(e)}")
|
227 |
+
return "κΈ°ν μ€λ₯"
|
228 |
+
|
229 |
+
# HTML λΈλ‘ μμ± ν¨μ
|
230 |
+
def generate_html(targets):
|
231 |
+
grouped_by_id = defaultdict(lambda: defaultdict(list))
|
232 |
+
for target in targets:
|
233 |
+
user_id = target['url'].split('/')[4] # μμ΄λ μΆμΆ
|
234 |
+
function = target['name'].split('-')[0] # κΈ°λ₯λ³ μΉ΄ν
κ³ λ¦¬ μΆμΆ
|
235 |
+
grouped_by_id[user_id][function].append(target)
|
236 |
+
|
237 |
+
status_html = "<h2>μμ΄λλ³ λ° κΈ°λ₯λ³ κ΅¬λΆ</h2>"
|
238 |
+
|
239 |
+
# μνλ³ ν
μ€νΈ μμ μ§μ
|
240 |
+
status_colors = {
|
241 |
+
"Running": "#4CAF50", # λ
Ήμ
|
242 |
+
"Sleeping": "#808080", # νμ
|
243 |
+
"Paused": "#FFA500", # μ£Όν©μ
|
244 |
+
"Building": "#2196F3", # νλμ
|
245 |
+
"Restarting": "#9C27B0", # 보λΌμ
|
246 |
+
"Starting": "#03A9F4", # νλμ
|
247 |
+
"μ€λ₯": "#FF0000", # λΉ¨κ°μ
|
248 |
+
"νμμμ": "#FF0000", # λΉ¨κ°μ
|
249 |
+
"μ°κ²° μ€λ₯": "#FF0000", # λΉ¨κ°μ
|
250 |
+
"κΈ°ν μ€λ₯": "#FF0000", # λΉ¨κ°μ
|
251 |
+
"μν λΆλͺ
": "#000000" # κ²μμ
|
252 |
+
}
|
253 |
+
|
254 |
+
for user_id, functions in grouped_by_id.items():
|
255 |
+
email, password = CREDENTIALS.get(user_id, ["N/A", "N/A"]) # μμ΄λλ³ μ΄λ©μΌ λ° λΉλ°λ²νΈ
|
256 |
+
status_html += (
|
257 |
+
f"<div style='border: 2px solid #4CAF50; padding: 10px; margin: 10px 0; border-radius: 8px;'>"
|
258 |
+
f"<h3 style='font-size: 1.5em; font-weight: bold;'>μμ΄λλͺ
: {user_id}</h3>"
|
259 |
+
f"<p><strong>μ΄λ©μΌ:</strong> {email}<br><strong>λΉλ°λ²νΈ:</strong> {password}</p>"
|
260 |
+
)
|
261 |
+
for function, items in functions.items():
|
262 |
+
status_html += (
|
263 |
+
f"<div style='padding: 8px; margin: 5px 0; background-color: #F9F9F9; border-radius: 5px;'>"
|
264 |
+
f"<strong style='font-size: 1.2em;'>{function}</strong><br>"
|
265 |
+
)
|
266 |
+
for item in items:
|
267 |
+
item_name = item["name"].split('-')[-1] # μ΄λ¦μ λ§μ§λ§ λΆλΆλ§ νμ
|
268 |
+
status = check_url_status(item["url"])
|
269 |
+
|
270 |
+
# μνμ λ°λ₯Έ ν
μ€νΈ μμ μ§μ
|
271 |
+
color = status_colors.get(status, "#000000")
|
272 |
+
|
273 |
+
item_html = (
|
274 |
+
f'<a href="{item["url"]}" target="_blank" style="color: {color}; '
|
275 |
+
f'text-decoration: none; margin: 2px; display: inline-block; '
|
276 |
+
f'padding: 5px; border: 1px solid #E0E0E0; border-radius: 3px;">'
|
277 |
+
f'{item_name} ({status})</a>'
|
278 |
+
)
|
279 |
+
status_html += item_html
|
280 |
+
status_html += "</div>"
|
281 |
+
status_html += "</div>"
|
282 |
+
|
283 |
+
return status_html
|
284 |
+
|
285 |
+
# λμ보λ μ
λ°μ΄νΈ ν¨μ
|
286 |
+
def update_dashboard():
|
287 |
+
# HTML λΈλ‘ μμ±
|
288 |
+
html_content = generate_html(TARGETS)
|
289 |
+
|
290 |
+
# νμ¬ μκ° (μ
λ°μ΄νΈ μκ°)
|
291 |
+
current_time = datetime.datetime.now(KST).strftime('%Y.%m.%d %H:%M:%S')
|
292 |
+
|
293 |
+
# μ΅μ’
HTML μμ±
|
294 |
+
full_html = f"{html_content}<p style='color: #7A7A7A;'>μ
λ°μ΄νΈ μκ°: {current_time}</p>"
|
295 |
+
|
296 |
+
return full_html
|
297 |
+
|
298 |
+
# μλ μ
λ°μ΄νΈλ₯Ό μν μΊμ λ³μλ€
|
299 |
+
dashboard_html_cache = ""
|
300 |
+
last_update_time = None
|
301 |
+
|
302 |
+
# λ§€μΌ μ€μ 7μμ μ€νλλ μ€μΌμ€λ¬ ν¨μ
|
303 |
+
def schedule_daily_check():
|
304 |
+
global dashboard_html_cache, last_update_time
|
305 |
+
while True:
|
306 |
+
now = datetime.datetime.now(KST)
|
307 |
+
if now.hour == 7 and now.minute == 0:
|
308 |
+
logging.info("μΌμΌ μν μ²΄ν¬ μ€ν μ€...")
|
309 |
+
# μλ μ
λ°μ΄νΈ λ‘μ§
|
310 |
+
dashboard_html_cache = generate_html(TARGETS)
|
311 |
+
last_update_time = now
|
312 |
+
logging.info(f"μΌμΌ μν μ²΄ν¬ μλ£: {now.strftime('%Y.%m.%d %H:%M:%S')}")
|
313 |
+
time.sleep(60) # μ€λ³΅ μ€ν λ°©μ§
|
314 |
+
time.sleep(30) # 30μ΄λ§λ€ μκ° νμΈ
|
315 |
+
|
316 |
+
# λμ보λ κ°μ Έμ€κΈ° ν¨μ
|
317 |
+
def get_dashboard():
|
318 |
+
global dashboard_html_cache, last_update_time
|
319 |
+
# μΊμκ° λΉμ΄μκ±°λ λ§μ§λ§ μ
λ°μ΄νΈ ν 1μκ°μ΄ μ§λ¬μΌλ©΄ μλ‘ μ
λ°μ΄νΈ
|
320 |
+
if dashboard_html_cache == "" or last_update_time is None or \
|
321 |
+
(datetime.datetime.now(KST) - last_update_time).seconds > 3600:
|
322 |
+
return update_dashboard()
|
323 |
+
|
324 |
+
# μΊμλ HTMLμ νμ¬ μκ° μΆκ°
|
325 |
+
current_time = datetime.datetime.now(KST).strftime('%Y.%m.%d %H:%M:%S')
|
326 |
+
return f"{dashboard_html_cache}<p style='color: #7A7A7A;'>μ
λ°μ΄νΈ μκ°: {current_time} (μΊμλ¨)</p>"
|
327 |
+
|
328 |
+
# μ± μμ± ν¨μ
|
329 |
+
def create_app():
|
330 |
+
# CSS μ€νμΌ μ μ - νΈν° μ¨κΉ λ° μΆκ° μ€νμΌ
|
331 |
+
custom_css = """
|
332 |
+
footer {visibility: hidden}
|
333 |
+
.gradio-container {max-width: 1200px}
|
334 |
+
.login-container {max-width: 500px; margin: 0 auto; padding: 20px;}
|
335 |
+
"""
|
336 |
+
|
337 |
+
with gr.Blocks(css=custom_css) as app:
|
338 |
+
# λ‘κ·ΈμΈ νμ΄μ§
|
339 |
+
with gr.Group(visible=True, elem_classes="login-container") as login_page:
|
340 |
+
gr.Markdown("# μλΉμ€ λμ보λ λ‘κ·ΈμΈ")
|
341 |
+
gr.Markdown("νκΉ
νμ΄μ€ μλΉμ€ λμ보λμ μ μνλ €λ©΄ λ‘κ·ΈμΈνμΈμ.")
|
342 |
+
username_input = gr.Textbox(label="μμ΄λ", placeholder="μμ΄λλ₯Ό μ
λ ₯νμΈμ")
|
343 |
+
password_input = gr.Textbox(label="λΉλ°λ²νΈ", placeholder="λΉλ°λ²νΈλ₯Ό μ
λ ₯νμΈμ", type="password")
|
344 |
+
login_btn = gr.Button("λ‘κ·ΈμΈ", variant="primary", scale=1)
|
345 |
+
login_message = gr.Textbox(label="μν", interactive=False, visible=False)
|
346 |
+
|
347 |
+
# λ©μΈ λμ보λ νμ΄μ§
|
348 |
+
with gr.Group(visible=False) as dashboard_page:
|
349 |
+
with gr.Row():
|
350 |
+
gr.Markdown("# νκΉ
νμ΄μ€ μλΉμ€ λμ보λ")
|
351 |
+
|
352 |
+
with gr.Row():
|
353 |
+
refresh_button = gr.Button("μν μλ‘κ³ μΉ¨", variant="primary")
|
354 |
+
logout_button = gr.Button("λ‘κ·Έμμ", variant="secondary")
|
355 |
+
|
356 |
+
status_html = gr.HTML()
|
357 |
+
|
358 |
+
# λ‘κ·ΈμΈ μ΄λ²€νΈ μ€μ
|
359 |
+
login_btn.click(
|
360 |
+
fn=process_login,
|
361 |
+
inputs=[username_input, password_input],
|
362 |
+
outputs=[login_page, dashboard_page, login_message, status_html]
|
363 |
+
)
|
364 |
+
|
365 |
+
# λμ보λ μλ‘κ³ μΉ¨ μ΄λ²€νΈ μ€μ
|
366 |
+
refresh_button.click(
|
367 |
+
fn=update_dashboard,
|
368 |
+
outputs=status_html
|
369 |
+
)
|
370 |
+
|
371 |
+
# λ‘κ·Έμμ μ΄λ²€νΈ μ€μ
|
372 |
+
logout_button.click(
|
373 |
+
fn=process_logout,
|
374 |
+
outputs=[login_page, dashboard_page, login_message, status_html]
|
375 |
+
)
|
376 |
+
|
377 |
+
# μ€μΌμ€λ¬ μ€λ λ μ€ν
|
378 |
+
threading.Thread(target=schedule_daily_check, daemon=True).start()
|
379 |
+
|
380 |
+
return app
|
381 |
+
|
382 |
+
# λ©μΈ μ€ν μ½λ
|
383 |
+
if __name__ == "__main__":
|
384 |
+
app = create_app()
|
385 |
+
app.launch(share=False, server_name="0.0.0.0", server_port=7860)
|