print('The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet to use this functionality.\n')
exit(1)
raiseSystemExit('The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet to use this functionality.\n')
else:
# For custom faucets, don't request captcha by default.
ifargs.captcha==DEFAULT_GLOBAL_CAPTCHA:
@ -120,28 +118,32 @@ session = requests.Session()
ifargs.captcha!='':# Retrieve a captcha
try:
res=session.get(args.captcha)
except:
print('Unexpected error when contacting faucet:',sys.exc_info()[0])
exit(1)
res.raise_for_status()
exceptrequests.exceptions.RequestExceptionase:
raiseSystemExit(f"Unexpected error when contacting faucet: {e}")
print('The binary',args.imagemagick,'could not be found. Please make sure ImageMagick (or a compatible fork) is installed and that the correct path is specified.')
exit(1)
raiseSystemExit(f"The binary {args.imagemagick}could not be found. Please make sure ImageMagick (or a compatible fork) is installed and that the correct path is specified.")
img=PPMImage(io.BytesIO(rv.stdout))
# Terminal interaction
print_image(img)
print('Enter captcha: ',end='')
data['captcha']=input()
print(f"Captcha from URL {args.captcha}")
data['captcha']=input('Enter captcha: ')
try:
res=session.post(args.faucet,data=data)
except:
print('Unexpected error when contacting faucet:',sys.exc_info()[0])
exit(1)
raiseSystemExit(f"Unexpected error when contacting faucet: {sys.exc_info()[0]}")
# Display the output as per the returned status code