Skip to content

Commit

Permalink
v20150924
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandaka committed Sep 24, 2015
1 parent 5fd321e commit a2854ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions PixivConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PixivConfig:
# Pixiv related?
numberOfPage = 0
r18mode = False
dateFormat = None
dateFormat = ''

# generic Settings
filenameFormat = unicode('%artist% (%member_id%)' + os.sep + '%urlFilename% - %title%')
Expand Down Expand Up @@ -404,7 +404,7 @@ def loadConfig(self, path=None):
self.dateFormat = config.get('Pixiv','dateFormat')
except ValueError:
print "dateFormat = ''"
self.dateFormat = None
self.dateFormat = ''
haveError = True


Expand Down
2 changes: 1 addition & 1 deletion PixivConstant.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-
# pylint: disable=I0011, C, C0302

PIXIVUTIL_VERSION = '20150923'
PIXIVUTIL_VERSION = '20150924'
PIXIVUTIL_LINK = 'https://nandaka.wordpress.com/tag/pixiv-downloader/'
PIXIV_URL = 'http://www.pixiv.net'
PIXIV_URL_SSL = 'https://www.secure.pixiv.net/login.php'
Expand Down
5 changes: 3 additions & 2 deletions PixivModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,13 @@ def ParseWorksData(self, page):
#2013年12月14日 19:00 855×1133 PhotoshopSAI

self.worksDate = PixivHelper.toUnicode(temp[0].string, encoding=sys.stdin.encoding)
if self.dateFormat is not None and len(self.dateFormat) > 0:
if self.dateFormat is not None and len(self.dateFormat) > 0 and '%' in self.dateFormat:
# use the user defined format
try:
self.worksDateDateTime = datetime.strptime(self.worksDate, self.dateFormat)
except ValueError as ve:
PixivHelper.GetLogger().exception('Error when parsing datetime: {0} for imageId {1} using date format {2}'.format(self.worksDate, self.imageId, self.dateFormat), ve)
PixivHelper.GetLogger().exception('Error when parsing datetime: {0} for imageId {1} using date format {2}'.format(self.worksDate, str(self.imageId), str(self.dateFormat)), ve)
raise
else:
self.worksDate = self.worksDate.replace(u'/', u'-')
if self.worksDate.find('-') > -1:
Expand Down
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
20150923:
20150924:
- Fix Issue #88: undefined variable when handling cookie.
- Externalize date format to config.ini, refer to http://strftime.org/ for formatting syntax
- Externalize date format to config.ini, refer to http://strftime.org/ for formatting syntax.

20150715:
- Fix Issue #87: Update login logic, now always use https.
Expand Down

0 comments on commit a2854ba

Please sign in to comment.