def getQRImage():
path = os.path.join(os.getcwd(), "qrcode.jpg")
url = "https://login.weixin.qq.com/qrcode/" + uuid
r = s.get(url, stream=True)
# debugReq(r)
if r.status_code == 200:
with open(path, 'wb') as f:
r.raw.decode_content = True
shutil.copyfileobj(r.raw, f)
import socket
ip = [l
for l in
([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2]
if not ip.startswith("127.")][:1],
[[(sc.connect(('8.8.8.8', 80)), sc.getsockname()[0], sc.close())
for sc in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]])
if l][0][0]
print "[+] Please open http://" + ip + ":" + str(http_port) + "/qrcode.jpg or open " + path
time.sleep(1)
评论列表
文章目录