Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,61 +1,18 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
def fetch_bs_stats(player_tag):
|
| 12 |
-
if not player_tag:
|
| 13 |
-
return "⚠️ Lütfen bir Oyuncu Etiketi (Tag) girin!"
|
| 14 |
-
tag = player_tag.upper().replace("#", "")
|
| 15 |
-
|
| 16 |
-
# Mobil uyumlu şık sonuç ekranı
|
| 17 |
-
html_output = f'''
|
| 18 |
-
<div style="background-color: #1e1e2e; padding: 15px; border-radius: 10px; color: white; font-family: sans-serif; margin-top: 10px;">
|
| 19 |
-
<h3 style="color: #ffcc00; margin: 0 0 10px 0;">🏆 Oyuncu Analizi (#{tag})</h3>
|
| 20 |
-
<p style="margin: 5px 0;"><b>Kullanıcı Adı:</b> StarPlayer_Pro</p>
|
| 21 |
-
<p style="margin: 5px 0;"><b>Toplam Kupa:</b> 34,520</p>
|
| 22 |
-
<p style="margin: 5px 0;"><b>Seviye:</b> 142</p>
|
| 23 |
-
<hr style="border: 0.5px solid #444; margin: 10px 0;">
|
| 24 |
-
<h3 style="color: #00ffcc; margin: 0 0 10px 0;">🎮 Son Maç Performansı</h3>
|
| 25 |
-
<p style="margin: 5px 0;"><b>Mod:</b> Hesaplaşma (Tek)</p>
|
| 26 |
-
<p style="margin: 5px 0;"><b>Karakter:</b> Mortis (Seviye 11)</p>
|
| 27 |
-
<p style="margin: 5px 0;"><b>Sonuç:</b> +8 Kupa (1.lik)</p>
|
| 28 |
-
</div>
|
| 29 |
-
'''
|
| 30 |
-
return html_output
|
| 31 |
-
|
| 32 |
-
with gr.Blocks(theme=gr.themes.Soft()) as bs_demo:
|
| 33 |
-
gr.Markdown("# 🏆 BRAWL STARS PRO ANALYZER")
|
| 34 |
-
|
| 35 |
-
# Giriş Ekranı
|
| 36 |
-
with gr.Column(visible=True) as login_box:
|
| 37 |
-
gr.Markdown("### 🔑 Giriş Kodu\nSisteme erişmek için satın aldığınız 100 TL'lik kodu girin.")
|
| 38 |
-
key_input = gr.Textbox(label="Lisans Kodu", placeholder="BS-XXXX-XX", type="password")
|
| 39 |
-
login_btn = gr.Button("Giriş Yap", variant="primary")
|
| 40 |
-
error_output = gr.Markdown()
|
| 41 |
-
|
| 42 |
-
# Ana İçerik
|
| 43 |
-
with gr.Column(visible=False) as main_content:
|
| 44 |
-
with gr.Tab("📊 İstatistik Sorgula"):
|
| 45 |
-
player_tag = gr.Textbox(label="Oyuncu Etiketi", placeholder="Örn: #9UUUYQY8R")
|
| 46 |
-
search_btn = gr.Button("Sorgula", variant="primary")
|
| 47 |
-
stats_output = gr.HTML()
|
| 48 |
-
|
| 49 |
-
with gr.Tab("🔥 Günlük Taktikler"):
|
| 50 |
-
gr.HTML('''
|
| 51 |
-
<div style="background-color: #2e2e3e; padding: 15px; border-radius: 8px; color: white; font-family: sans-serif;">
|
| 52 |
-
<p style="color: #ff3366; margin: 0 0 8px 0;"><b>Bugünün En İyi Karakteri:</b> Spike</p>
|
| 53 |
-
<p style="margin: 0;"><b>Harita Taktiği:</b> Ortadaki kutulara erken girmeyin, pusarak oynayın.</p>
|
| 54 |
-
</div>
|
| 55 |
-
''')
|
| 56 |
-
|
| 57 |
-
login_btn.click(check_bs_license, inputs=[key_input], outputs=[login_box, main_content, error_output])
|
| 58 |
-
search_btn.click(fetch_bs_stats, inputs=[player_tag], outputs=[stats_output])
|
| 59 |
|
| 60 |
if __name__ == "__main__":
|
| 61 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import requests
|
| 3 |
|
| 4 |
+
def get_hf_ip():
|
| 5 |
+
try:
|
| 6 |
+
# Sunucunun dış dünyaya hangi IP ile çıktığını öğreniyoruz
|
| 7 |
+
ip = requests.get("https://api4.icanhazip.com", timeout=5).text.strip()
|
| 8 |
+
return f"🌐 Hugging Face Sunucu IP Adresiniz: {ip}"
|
| 9 |
+
except Exception as e:
|
| 10 |
+
return f"🚨 IP Alınamadı: {str(e)}"
|
| 11 |
|
| 12 |
+
with gr.Blocks() as demo:
|
| 13 |
+
gr.Markdown("# 🔍 Hugging Face IP Bulucu")
|
| 14 |
+
ip_output = gr.Textbox(label="Supercell Sitesine Eklenecek IP", value=get_hf_ip())
|
| 15 |
+
gr.Markdown("Bu IP adresini kopyalayıp Brawl Stars Developer sitesindeki mevcut anahtarınıza ekleyin.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|
| 18 |
+
demo.launch()
|