alikayh commited on
Commit
caccf22
·
verified ·
1 Parent(s): 761bc1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -14,12 +14,15 @@ if st.button("Give me Proxy!"):
14
  try:
15
  response = requests.get('https://mtpro.xyz/api/?type=mtproto')
16
  data = response.json()
17
- st.write("Data fetched from API:")
18
- st.write(data) # Debug statement to display fetched data
19
-
20
  results = st.empty()
21
- results.empty()
22
  results.markdown("<div class='result'>", unsafe_allow_html=True)
 
 
 
 
 
 
23
  for i in range(min(20, len(data))):
24
  proxy_link = f"https://t.me/proxy?server={data[i]['host']}&port={data[i]['port']}&secret={data[i]['secret']}"
25
  results.markdown(f"<p>Proxy Link: <a href='{proxy_link}'>{proxy_link}</a></p>", unsafe_allow_html=True)
 
14
  try:
15
  response = requests.get('https://mtpro.xyz/api/?type=mtproto')
16
  data = response.json()
17
+
 
 
18
  results = st.empty()
 
19
  results.markdown("<div class='result'>", unsafe_allow_html=True)
20
+ results.markdown("<h3>API Response:</h3>", unsafe_allow_html=True)
21
+ results.markdown(f"<pre>{data}</pre>", unsafe_allow_html=True) # Display the API response in a readable format
22
+ results.markdown("</div>", unsafe_allow_html=True)
23
+
24
+ results.markdown("<div class='result'>", unsafe_allow_html=True)
25
+ results.markdown("<h3>Proxy Links:</h3>", unsafe_allow_html=True)
26
  for i in range(min(20, len(data))):
27
  proxy_link = f"https://t.me/proxy?server={data[i]['host']}&port={data[i]['port']}&secret={data[i]['secret']}"
28
  results.markdown(f"<p>Proxy Link: <a href='{proxy_link}'>{proxy_link}</a></p>", unsafe_allow_html=True)