TweepError:[{u' message':u' SSL是必需的',u'代码':92}]

时间:2014-09-27 07:02:22

标签: python

这是我从我的帐户中获取推文的python脚本

import tweepy

consumer_key=""
consumer_secret=""
access_token=""
acces_token_secret=""
auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api.tweepy.API(auth)

public_tweets = api.home_timeline()
for tweet in public_tweets:
   print tweet.text

但是我收到以下错误:

Traceback (most recent call last):
File "C:\enter code herePython27\twitter_api.py", line 16, in <module>
    public_tweets = api.home_timeline()

File "build\bdist.win32\egg\tweepy\binder.py", line 185, in _call
    return method.execute()

File "build\bdist.win32\egg\tweepy\binder.py", line 168, in execute
    raise TweepError(error_msg, resp)

TweepError: [{u'message': u'SSL is required', u'code': 92}]

请帮忙

1 个答案:

答案 0 :(得分:0)

试试这个:

auth=tweepy.OAuthHandler(consumer_key, consumer_secret, secure=True)