大家好我试图订阅Instagram API,但由于某种原因我一直在收到错误。
码
# Subscribe to all media in a geographic area
api.create_subscription(object='geography', lat=35.657872, lng=139.70232, radius=1000, aspect='media', callback_url='http://locallhost.com/')
错误:
Traceback (most recent call last):
File "C:/Users/Owner.Owner-PC/Documents/Final Year Project/testing.py", line 26, in <module>
api.create_subscription(object='geography', lat=35.657872, lng=139.70232, radius=1000, aspect='media', callback_url='http://locallhost.com/')
File "C:\Python 3.5\lib\site-packages\instagram\bind.py", line 197, in _call
return method.execute()
File "C:\Python 3.5\lib\site-packages\instagram\bind.py", line 189, in execute
content, next = self._do_api_request(url, method, body, headers)
File "C:\Python 3.5\lib\site-packages\instagram\bind.py", line 123, in _do_api_request
signature = hmac.new(secret, ips, sha256).hexdigest()
File "C:\Python 3.5\lib\hmac.py", line 144, in new
return HMAC(key, msg, digestmod)
File "C:\Python 3.5\lib\hmac.py", line 42, in __init__
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
TypeError: key: expected bytes or bytearray, but got 'str'
现在我很困惑错误是什么,有人可以解释一下如何解决这个问题吗?