mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-06 03:42:29 -04:00
Update Twitter session to Tweepy V4.5.0
This commit is contained in:
parent
1262a9d784
commit
cf56b518d6
@ -136,8 +136,7 @@ class Session(base.baseSession):
|
|||||||
if self.settings["twitter"]["user_key"] != None and self.settings["twitter"]["user_secret"] != None:
|
if self.settings["twitter"]["user_key"] != None and self.settings["twitter"]["user_secret"] != None:
|
||||||
try:
|
try:
|
||||||
log.debug("Logging in to twitter...")
|
log.debug("Logging in to twitter...")
|
||||||
self.auth = tweepy.OAuthHandler(appkeys.twitter_api_key, appkeys.twitter_api_secret)
|
self.auth = tweepy.OAuth1UserHandler(consumer_key=appkeys.twitter_api_key, consumer_secret=appkeys.twitter_api_secret, access_token=self.settings["twitter"]["user_key"], access_token_secret=self.settings["twitter"]["user_secret"])
|
||||||
self.auth.set_access_token(self.settings["twitter"]["user_key"], self.settings["twitter"]["user_secret"])
|
|
||||||
self.twitter = tweepy.API(self.auth)
|
self.twitter = tweepy.API(self.auth)
|
||||||
self.twitter_v2 = tweepy.Client(consumer_key=appkeys.twitter_api_key, consumer_secret=appkeys.twitter_api_secret, access_token=self.settings["twitter"]["user_key"], access_token_secret=self.settings["twitter"]["user_secret"])
|
self.twitter_v2 = tweepy.Client(consumer_key=appkeys.twitter_api_key, consumer_secret=appkeys.twitter_api_secret, access_token=self.settings["twitter"]["user_key"], access_token_secret=self.settings["twitter"]["user_secret"])
|
||||||
if verify_credentials == True:
|
if verify_credentials == True:
|
||||||
@ -158,7 +157,7 @@ class Session(base.baseSession):
|
|||||||
if self.logged == True:
|
if self.logged == True:
|
||||||
raise Exceptions.AlreadyAuthorisedError("The authorisation process is not needed at this time.")
|
raise Exceptions.AlreadyAuthorisedError("The authorisation process is not needed at this time.")
|
||||||
else:
|
else:
|
||||||
self.auth = tweepy.OAuthHandler(appkeys.twitter_api_key, appkeys.twitter_api_secret)
|
self.auth = tweepy.OAuth1UserHandler(appkeys.twitter_api_key, appkeys.twitter_api_secret)
|
||||||
redirect_url = self.auth.get_authorization_url()
|
redirect_url = self.auth.get_authorization_url()
|
||||||
webbrowser.open_new_tab(redirect_url)
|
webbrowser.open_new_tab(redirect_url)
|
||||||
self.authorisation_dialog = authorisationDialog()
|
self.authorisation_dialog = authorisationDialog()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user