Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
# List of proxies
|
4 |
+
proxies = [
|
5 |
+
"130.61.171.71",
|
6 |
+
"38.54.71.67"
|
7 |
+
"8.219.97.248",
|
8 |
+
|
9 |
+
|
10 |
+
# Add more proxies as needed
|
11 |
+
]
|
12 |
+
|
13 |
+
# URL to download
|
14 |
+
url = "http://zoom.lk"
|
15 |
+
|
16 |
+
# Generate and execute wget commands
|
17 |
+
for proxy in proxies:
|
18 |
+
command = ['wget','--timeout=3', '-e', 'use_proxy=yes', '-e', f'http_proxy=http://{proxy}:80', url]
|
19 |
+
|
20 |
+
# Print the command
|
21 |
+
print(f"Running command: {' '.join(command)}")
|
22 |
+
|
23 |
+
# Execute the command and capture output live
|
24 |
+
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
25 |
+
|
26 |
+
while True:
|
27 |
+
output = process.stdout.readline()
|
28 |
+
if output == b'' and process.poll() is not None:
|
29 |
+
break
|
30 |
+
if output:
|
31 |
+
print(output.decode().strip())
|
32 |
+
|
33 |
+
# Capture any error messages
|
34 |
+
stderr_output = process.stderr.read()
|
35 |
+
if stderr_output:
|
36 |
+
print(stderr_output.decode().strip())
|