mirror of
https://github.com/nikdoof/flexget-plugins.git
synced 2025-12-17 03:39:25 +00:00
If the username/password is validated, don't recheck for each feed
This commit is contained in:
@@ -25,6 +25,9 @@ class OutputTwitter:
|
||||
password: blargh
|
||||
|
||||
"""
|
||||
|
||||
_validated = False
|
||||
|
||||
def validator(self):
|
||||
from flexget import validator
|
||||
twitter = validator.factory('dict')
|
||||
@@ -55,8 +58,11 @@ class OutputTwitter:
|
||||
log.debug("Loading twitter api")
|
||||
api = twitter.Api(username=config['username'], password=config['password'])
|
||||
|
||||
if not api.GetFriends():
|
||||
log.warn("Invalid twitter username or password")
|
||||
if not self._validated:
|
||||
try:
|
||||
api.GetFriends()
|
||||
except TwitterError:
|
||||
log.warn("Error testing twitter connectivity, check your username/password")
|
||||
return
|
||||
|
||||
entries_count = len(feed.accepted)
|
||||
|
||||
Reference in New Issue
Block a user