Hjgugugjhuhjggg commited on
Commit
3f46d08
1 Parent(s): bb8a421

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -8,6 +8,9 @@ import gradio as gr
8
  import os
9
  from dotenv import load_dotenv
10
  import spaces
 
 
 
11
 
12
  load_dotenv()
13
 
@@ -94,6 +97,22 @@ def remove_duplicates(text):
94
  seen_lines.add(line)
95
  return '\n'.join(unique_lines)
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  @spaces.GPU(
98
  queue=False,
99
  allow_gpu_memory=True,
@@ -283,4 +302,4 @@ iface = gr.Interface(
283
 
284
  if __name__ == "__main__":
285
  port = int(os.environ.get("PORT", 7860))
286
- iface.launch(server_port=port)
 
8
  import os
9
  from dotenv import load_dotenv
10
  import spaces
11
+ import requests
12
+ import random
13
+ from faker import Faker
14
 
15
  load_dotenv()
16
 
 
97
  seen_lines.add(line)
98
  return '\n'.join(unique_lines)
99
 
100
+ PROXY_URL = "https://uhhy-fsfsfs.hf.space/valid"
101
+
102
+ def get_random_proxy():
103
+ try:
104
+ response = requests.get(PROXY_URL)
105
+ proxies = response.text.splitlines()
106
+ return random.choice(proxies)
107
+ except Exception as e:
108
+ print(f"Error fetching proxy: {e}")
109
+ return None
110
+
111
+ fake = Faker()
112
+
113
+ def generate_fake_ip():
114
+ return fake.ipv4()
115
+
116
  @spaces.GPU(
117
  queue=False,
118
  allow_gpu_memory=True,
 
302
 
303
  if __name__ == "__main__":
304
  port = int(os.environ.get("PORT", 7860))
305
+ iface.launch(server_port=port)