eh_wechat_slave.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:ehForwarderBot 作者: blueset 项目源码 文件源码
def console_qr_code(self, uuid, status, qrcode):
        status = int(status)
        if status == 201:
            QR = 'Tap "Confirm" to continue.'
            return self.logger.critical(QR)
        elif status == 200:
            QR = "Successfully authorized."
            return self.logger.critical(QR)
        elif uuid != self.qr_uuid:
            # 0: First QR code
            # 408: Updated QR code
            QR = "WeChat: Scan QR code with WeChat to continue. (%s, %s)\n" % (uuid, status)
            if status == 408:
                QR += "Previous code expired. Please scan the new one.\n"
            QR += "\n"
            qr_url = "https://login.weixin.qq.com/l/" + uuid
            qr_obj = QRCode(qr_url)
            if self._flag("imgcat_qr", False):
                qr_file = io.BytesIO()
                qr_obj.png(qr_file, scale=10)
                QR += self.imgcat(qr_file, "%s_QR_%s.png" % (self.channel_id, uuid))
            else:
                QR += qr_obj.terminal()
            QR += "\nIf you cannot read the QR code above, " \
                  "please visit the following URL:\n" \
                  "https://login.weixin.qq.com/qrcode/" + uuid
            return self.logger.critical(QR)
        self.qr_uuid = uuid
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号