Skip to content

Commit

Permalink
login: support qrcode png
Browse files Browse the repository at this point in the history
Signed-off-by: xiao bo <[email protected]>
  • Loading branch information
peterwillcn committed Nov 23, 2024
1 parent cf84e57 commit 3c51d78
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions channel/wechat/wechat_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import threading
import time
import requests
import qrcode

from bridge.context import *
from bridge.reply import *
Expand Down Expand Up @@ -87,6 +88,14 @@ def qrCallback(uuid, status, qrcode):

url = f"https://login.weixin.qq.com/l/{uuid}"

img = qrcode.make(data=url)

if not os.path.exists('tmp'):
os.makedirs('tmp')

with open('tmp/login.png', 'wb') as f:
img.save(f)

qr_api1 = "https://api.isoyu.com/qr/?m=1&e=L&p=20&url={}".format(url)
qr_api2 = "https://api.qrserver.com/v1/create-qr-code/?size=400×400&data={}".format(url)
qr_api3 = "https://api.pwmqr.com/qrcode/create/?url={}".format(url)
Expand Down

0 comments on commit 3c51d78

Please sign in to comment.