Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -76,15 +76,31 @@ def process_url_for_iframe(url):
|
|
76 |
# ํ๊น
ํ์ด์ค URL ํจํด ๊ฐ์ง
|
77 |
is_huggingface = False
|
78 |
|
79 |
-
#
|
80 |
-
if "
|
81 |
is_huggingface = True
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
|
|
88 |
return url, is_huggingface
|
89 |
|
90 |
# โโโโโโโโโโโโโโโโโโโโโ 6. HTML ๊ทธ๋ฆฌ๋ โโโโโโโโโโโโโโโโโโโ
|
@@ -260,7 +276,7 @@ def html(cards, pg, total):
|
|
260 |
width="100%"
|
261 |
height="100%"
|
262 |
allowfullscreen="true"
|
263 |
-
allow="accelerometer; camera; encrypted-media; gyroscope;
|
264 |
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads">
|
265 |
</iframe>
|
266 |
</div>
|
|
|
76 |
# ํ๊น
ํ์ด์ค URL ํจํด ๊ฐ์ง
|
77 |
is_huggingface = False
|
78 |
|
79 |
+
# huggingface.co/spaces ํจํด ์ฒ๋ฆฌ
|
80 |
+
if "huggingface.co/spaces" in url:
|
81 |
is_huggingface = True
|
82 |
+
try:
|
83 |
+
# URL์์ owner์ name ์ถ์ถ
|
84 |
+
parts = url.split('/spaces/')[1].split('/')
|
85 |
+
owner = parts[0]
|
86 |
+
name = parts[1] if len(parts) > 1 else ""
|
87 |
+
|
88 |
+
# ํน์ ๋ฌธ์ ์ฒ๋ฆฌ ๋ฐ ์๋ฌธ์ ๋ณํ
|
89 |
+
name = name.replace('.', '-').replace('_', '-').lower()
|
90 |
+
owner = owner.lower()
|
91 |
+
|
92 |
+
# ์ URL ํ์ ์ ์ฉ
|
93 |
+
return f"https://{owner}-{name}.hf.space", is_huggingface
|
94 |
+
except:
|
95 |
+
# ์ค๋ฅ ๋ฐ์์ ์๋ URL ์ฌ์ฉ
|
96 |
+
return url, is_huggingface
|
97 |
+
|
98 |
+
# ์ด๋ฏธ .hf.space ๋๋ฉ์ธ์ธ ๊ฒฝ์ฐ
|
99 |
+
elif ".hf.space" in url:
|
100 |
+
is_huggingface = True
|
101 |
+
return url, is_huggingface
|
102 |
|
103 |
+
# ์ผ๋ฐ URL์ ๊ทธ๋๋ก ๋ฐํ
|
104 |
return url, is_huggingface
|
105 |
|
106 |
# โโโโโโโโโโโโโโโโโโโโโ 6. HTML ๊ทธ๋ฆฌ๋ โโโโโโโโโโโโโโโโโโโ
|
|
|
276 |
width="100%"
|
277 |
height="100%"
|
278 |
allowfullscreen="true"
|
279 |
+
allow="accelerometer; camera; encrypted-media; gyroscope; geolocation;"
|
280 |
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads">
|
281 |
</iframe>
|
282 |
</div>
|