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
|
password: blargh
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
_validated = False
|
||||||
|
|
||||||
def validator(self):
|
def validator(self):
|
||||||
from flexget import validator
|
from flexget import validator
|
||||||
twitter = validator.factory('dict')
|
twitter = validator.factory('dict')
|
||||||
@@ -55,9 +58,12 @@ class OutputTwitter:
|
|||||||
log.debug("Loading twitter api")
|
log.debug("Loading twitter api")
|
||||||
api = twitter.Api(username=config['username'], password=config['password'])
|
api = twitter.Api(username=config['username'], password=config['password'])
|
||||||
|
|
||||||
if not api.GetFriends():
|
if not self._validated:
|
||||||
log.warn("Invalid twitter username or password")
|
try:
|
||||||
return
|
api.GetFriends()
|
||||||
|
except TwitterError:
|
||||||
|
log.warn("Error testing twitter connectivity, check your username/password")
|
||||||
|
return
|
||||||
|
|
||||||
entries_count = len(feed.accepted)
|
entries_count = len(feed.accepted)
|
||||||
if entries_count == 0:
|
if entries_count == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user