whatsapp에 대한 API에서 작업 중이며 Yowsup을 사용 중입니다. 내가 Yowsup Cli 클라이언트를 사용할 때 whatsapp 계정에 로그인하여 메시지를주고받습니다. 다음 스크립트를 사용하려고하면 "Auth Failed!"가 반환됩니다.Yowsup auth fail whatsapp
import sys
import os
import logging
import time
import shutil
import Queue
from collections import defaultdict
from Yowsup.Common.debugger import Debugger
from Yowsup.connectionmanager import YowsupConnectionManager
from py_utils import logutils
from py_utils import executable_utils
from py_utils import exception_utils
from py_utils.cli_utils import actions_handler
COUNTRY_CODE = "COUNTRY_NUM"
PHONE_NUMBER = "MYNUMBER"
# IDENTITY = ""
PASSWORD = 'MY_PASS_WORD'
LOGIN = COUNTRY_CODE + PHONE_NUMBER
import argparse, sys, os, csv
from Yowsup.Common.utilities import Utilities
from Yowsup.Common.debugger import Debugger
from Yowsup.Common.constants import Constants
from Yowsup.Contacts.contacts import WAContactsSyncRequest
from Yowsup.connectionmanager import YowsupConnectionManager
import threading,time, base64
########## DO NOT COMMIT THIS FILE WITH YOUR CREDENTIALS ###########
#.....................WhatsApp Account Config.......................
nickname = "lamaaaaaaa"
username = LOGIN
password = PASSWORD
id = "" # Not required
#....................................................................
# Degug is False by default if you add -d you will set it to True
Debugger.enabled = True if '-d' in sys.argv else False
password = base64.b64decode(bytes(password.encode('utf-8')))
def login(username, password):
print "[] Logging in as %s (%s)\n" % (nickname, username)
methodsInterface.call("auth_login", (username, password))
def onAuthSuccess(username):
print("Authed!!\n\n")
methodsInterface.call("ready")
methodsInterface.call("presence_sendAvailableForChat", (nickname,))
def onAuthFailed(username, err):
print("Auth Failed!")
########################### BIND EVENTS #############################
connectionManager = YowsupConnectionManager()
signalsInterface = connectionManager.getSignalsInterface()
methodsInterface = connectionManager.getMethodsInterface()
connectionManager.setAutoPong(True)
signalsInterface.registerListener("auth_success", onAuthSuccess)
signalsInterface.registerListener("auth_fail", onAuthFailed)
#####################################################################
login(username, password)
를 사용해야합니다. Common.debugger 가져 오기 디버거 및 Yowsup.connectionmanager 가져 오기에서 YowsupConnectionManager가 실행 중 오류가 발생합니까? 어떤 도움? 나는 이것이 경로로 무언가를해야한다고 생각한다. ??? – ZdaR