File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ def get_client():
5858 print ("Please login first" )
5959 sys .exit (1 )
6060
61- client = InoreaderClient (appid , appkey , token )
61+ userid = None
62+ if config .has_section ('user' ):
63+ userid = config .get ('user' , 'id' )
64+
65+ client = InoreaderClient (appid , appkey , userid = userid , auth_token = token )
6266 return client
6367
6468
@@ -95,6 +99,10 @@ def login():
9599 config ['auth' ]['token' ] = auth_token
96100 else :
97101 config ['auth' ] = {'token' : auth_token }
102+
103+ appid , appkey = get_appid_key (config )
104+ client = InoreaderClient (appid , appkey , auth_token = auth_token )
105+ config ['user' ] = {'email' : username , 'id' : client .userinfo ()['userId' ]}
98106 with codecs .open (CONFIG_FILE , mode = 'w' , encoding = 'utf-8' ) as fconfig :
99107 config .write (fconfig )
100108 print ("save token in {}, " .format (username , CONFIG_FILE ))
You can’t perform that action at this time.
0 commit comments