Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import requests | |
| # Set page title and background color | |
| st.title("MTProto KayH GNG Collector") | |
| st.markdown("<h2 style='text-align: center;'>لازم به ذکر است برای دریافت پروکسی ها بنا بر فیلتر شدن آدرس از فیلترشکن استفاده کنید</h2>", 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("<div class='result'>", unsafe_allow_html=True) | |
| results.markdown("<h3>API Response:</h3>", unsafe_allow_html=True) | |
| results.markdown(f"<pre>{data}</pre>", unsafe_allow_html=True) # Display the API response in a readable format | |
| results.markdown("</div>", unsafe_allow_html=True) | |
| results.markdown("<div class='result'>", unsafe_allow_html=True) | |
| results.markdown("<h3>Proxy Links:</h3>", 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"<p>Proxy Link: <a href='{proxy_link}'>{proxy_link}</a></p>", unsafe_allow_html=True) | |
| results.markdown("</div>", unsafe_allow_html=True) | |
| except Exception as e: | |
| st.error(f"Error giving Proxy :( : {e}") | |
| else: | |
| st.error("شما باید 'Iran' را در ورودی وارد کنید.") |