OP 04 January, 2023 - 06:32 PM
Code:
import requests
import random
import string
def generate_link(id):
return f'https://prnt.sc/{id}'
# Get all the letters and digits
characters = string.ascii_letters + string.digits
# Generate a random 6 letter or digit string
id = ''.join(random.choices(characters, k=6))
# Read the proxy list from the text file
with open('proxies.txt', 'r') as f:
proxy_list = f.readlines()
# Convert the proxy list to a dictionary
proxies = {}
for proxy in proxy_list:
ip, port = proxy.split(":")
proxies[ip] = port
# Create a link using the random string
link = generate_link(id)
# Send a request to the link using the proxies
response = requests.get(link, proxies=proxies)
# Check the status code to see if the link is valid
if response.status_code == 200:
print(f'Link is valid: {link}')
else:
print(f'Link is invalid: {link}')