import streamlit as st
import requests
# Set page title and background color
st.title("MTProto KayH GNG Collector")
st.markdown("
لازم به ذکر است برای دریافت پروکسی ها بنا بر فیلتر شدن آدرس از فیلترشکن استفاده کنید
", unsafe_allow_html=True)
# Input field for location
location = st.text_input("Enter your location:")
# Button to fetch data
if st.button("Give me Proxy!"):
if location.strip().lower() == "iran":
try:
response = requests.get('https://mtpro.xyz/api/?type=mtproto')
data = response.json()
results = st.empty()
results.markdown("", unsafe_allow_html=True)
results.markdown("
API Response:
", unsafe_allow_html=True)
results.markdown(f"
{data}
", unsafe_allow_html=True) # Display the API response in a readable format
results.markdown("
", unsafe_allow_html=True)
results.markdown("", unsafe_allow_html=True)
results.markdown("
Proxy Links:
", unsafe_allow_html=True)
for i in range(min(20, len(data))):
proxy_link = f"https://t.me/proxy?server={data[i]['host']}&port={data[i]['port']}&secret={data[i]['secret']}"
results.markdown(f"
Proxy Link: {proxy_link}
", unsafe_allow_html=True)
results.markdown("
", unsafe_allow_html=True)
except Exception as e:
st.error(f"Error giving Proxy :( : {e}")
else:
st.error("شما باید 'Iran' را در ورودی وارد کنید.")