Last active
July 23, 2019 16:38
-
-
Save dan-r95/c60af5e4377fa25c2e88ffc0d47e846f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/ustayready/fireprox | |
import requests | |
import json | |
import traceback | |
numSuccessFull = 0 | |
ip = '' | |
port = '' | |
limit1Reached = False | |
limit2Reached = False | |
while (numSuccessFull < 10): | |
try: | |
r = requests.get( | |
'https://gimmeproxy.com/api/getProxy?supportsHttps=true') | |
jsonTmp = json.loads(r.content) | |
if(jsonTmp.get('status_message')) is not None: | |
if 'Your request count is over the allowed limit of 10.' in jsonTmp['status_message']: | |
print(jsonTmp['status_message']) | |
print('limit 1 reached :/') | |
limit1Reached = True | |
r = requests.get( | |
'https://api.getproxylist.com/proxy?allowsHttps=1&/proxy?maxConnectTime=1?lastTested=1000') | |
jsonTmp = json.loads(r.content) | |
if(jsonTmp.get('status_message')) is not None: | |
print(jsonTmp['status_message']) | |
print('limit 2 reached :/') | |
limit2Reached = True | |
if limit1Reached and limit2Reached: | |
exit(0) | |
port = str(jsonTmp['port']) | |
ip = jsonTmp['ip'] | |
except Exception: | |
print(traceback.format_exc()) | |
break | |
proxyDict = { | |
"https": 'https://' + ip + ':' + port, | |
} | |
print(proxyDict['https']) | |
url = 'https://change.pennergame.de/change_please/<id>/' | |
try: | |
r = requests.get(url, proxies=proxyDict) | |
except Exception: | |
print(traceback.format_exc()) | |
pass | |
# Check if the proxy was indeed used (the text should contain the proxy IP). | |
if "Du kannst erst" in r.text: | |
print('err') | |
elif 'Du hast €' in r.text: | |
print('success') | |
elif 'hat heute schon genug Spenden erhalten.' in r.text: | |
print('Done!') | |
exit(0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment