[feedly] fix feedly login
This commit is contained in:
parent
53f430286c
commit
ec22de45ad
4 changed files with 13 additions and 6 deletions
|
|
@ -28,9 +28,9 @@ __all__ = ['FeedlyBrowser']
|
|||
|
||||
|
||||
class FeedlyBrowser(LoginBrowser):
|
||||
BASEURL = 'http://www.feedly.com/'
|
||||
BASEURL = 'https://www.feedly.com/'
|
||||
|
||||
essentials = URL('http://s3.feedly.com/essentials/essentials_fr.json', EssentialsPage)
|
||||
essentials = URL('https://s3.feedly.com/essentials/essentials_fr.json', EssentialsPage)
|
||||
token = URL('v3/auth/token', TokenPage)
|
||||
contents = URL('v3/streams/contents', ContentsPage)
|
||||
preferences = URL('v3/preferences', PreferencesPage)
|
||||
|
|
|
|||
|
|
@ -26,17 +26,19 @@ from weboob.exceptions import BrowserIncorrectPassword
|
|||
|
||||
class GoogleLoginPage(LoggedPage, HTMLPage):
|
||||
def login(self, login, passwd):
|
||||
form = self.get_form('//form[@id="gaia_loginform"]')
|
||||
form = self.get_form('//form[@id="gaia_loginform"]', submit='//input[@id="signIn"]')
|
||||
form['Email'] = login
|
||||
form['Passwd'] = passwd
|
||||
form.submit()
|
||||
|
||||
|
||||
class GoogleBrowser(LoginBrowser):
|
||||
BASEURL = 'https://accounts.google.com'
|
||||
BASEURL = 'https://accounts.google.com/'
|
||||
|
||||
code = None
|
||||
google_login = URL('https://accounts.google.com/(?P<auth>.+)', GoogleLoginPage)
|
||||
google_login = URL('https://accounts.google.com/(?P<auth>.+)',
|
||||
'AccountLoginInfo',
|
||||
GoogleLoginPage)
|
||||
|
||||
def __init__(self, username, password, redirect_uri, *args, **kwargs):
|
||||
super(GoogleBrowser, self).__init__(username, password, *args, **kwargs)
|
||||
|
|
@ -50,6 +52,9 @@ class GoogleBrowser(LoginBrowser):
|
|||
queryString = "&".join([key+'='+value for key, value in params.items()])
|
||||
self.google_login.go(auth='o/oauth2/auth', params=queryString).login(self.username, self.password)
|
||||
|
||||
if self.google_login.is_here():
|
||||
self.page.login(self.username, self.password)
|
||||
|
||||
try:
|
||||
self.code = parse_qs(urlparse(self.url).query).get('code')[0]
|
||||
except:
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class FeedlyModule(Module, CapMessages, CapCollection):
|
|||
if article.id == id:
|
||||
entry = article
|
||||
if entry is None:
|
||||
|
||||
return None
|
||||
|
||||
if thread.id not in self.storage.get('seen', default=[]):
|
||||
|
|
@ -107,7 +108,7 @@ class FeedlyModule(Module, CapMessages, CapCollection):
|
|||
if username:
|
||||
password = self.config['password'].get()
|
||||
login_browser = GoogleBrowser(username, password,
|
||||
'https://feedly.com/v3/auth/callback&scope=profile+email&state=Ak7fo397ImkiOiJmZWVkbHkiLCJyIjoiaHR0cDovL2ZlZWRseS5jb20vZmVlZGx5Lmh0bWwiLCJwIjoiR29vZ)2xlUGx1cyIsImMiOiJmZWVkbHkuZGVza3RvcCAyMC40Ljc3NSJ9')
|
||||
'https://feedly.com/v3/auth/callback&scope=profile+email&state=Amm-1gV7ImkiOiJmZWVkbHkiLCJycCI6IndlbGNvbWUiLCJyIjoiaHR0cDovL2ZlZWRseS5jb20vZmVlZGx5Lmh0bWwiLCJwIjoiR29vZ2xlUGx1cyIsImMiOiJmZWVkbHkuZGVza3RvcCAyOC4wLjk1NSJ9')
|
||||
else:
|
||||
password = None
|
||||
login_browser = None
|
||||
|
|
|
|||
|
|
@ -88,5 +88,6 @@ class PreferencesPage(LoggedPage, JsonPage):
|
|||
if value in [u"shown", u"hidden"]:
|
||||
yield Collection([u'%s' % category], u'%s' % category.replace('global.', ''))
|
||||
|
||||
|
||||
class MarkerPage(LoggedPage):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue