Skip to content

Commit

Permalink
Fix Issue #115: update login method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandaka committed May 13, 2016
1 parent 0696d1f commit cc53584
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
22 changes: 17 additions & 5 deletions PixivBrowserFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,25 @@ def loginHttps(self, username, password):
PixivHelper.printAndLog('info', 'Log in using secure form.')
self.open(PixivConstant.PIXIV_URL_SSL)

self.select_form(predicate=lambda f: f.attrs.get('action', None) == '/login.php')
self['pixiv_id'] = username
self['pass'] = password
#self.select_form(predicate=lambda f: f.attrs.get('action', None) == '/login.php')
#self['pixiv_id'] = username
#self['pass'] = password
#if self._config.keepSignedIn:
# self.find_control('skip').items[0].selected = True

#response = self.submit()

data = {}
data['mode'] = 'login'
data['return_to'] = '/'
data['pixiv_id'] = username
data['pass'] = password
if self._config.keepSignedIn:
self.find_control('skip').items[0].selected = True
data['skip'] = '1'
else:
data['skip'] = '0'
response = self.open("https://www.pixiv.net/login.php", urllib.urlencode(data))

response = self.submit()
return self.processLoginResult(response, )
except:
PixivHelper.printAndLog('error', 'Error at loginHttps(): ' + str(sys.exc_info()))
Expand Down
2 changes: 1 addition & 1 deletion PixivConstant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=I0011, C, C0302


PIXIVUTIL_VERSION = '20160508-beta1'
PIXIVUTIL_VERSION = '20160513'
PIXIVUTIL_LINK = 'https://nandaka.wordpress.com/tag/pixiv-downloader/'
PIXIV_URL = 'http://www.pixiv.net'
PIXIV_URL_SSL = 'https://www.pixiv.net/login.php'
Expand Down
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
20160508-beta1
20160513
- Add null check before dumping html.
- Fix Issue #115: update login method.

20160421
- Implement #108: enhance window titlebar to calculate the total images.
Expand Down

0 comments on commit cc53584

Please sign in to comment.