]> git.lizzy.rs Git - nhentai.git/commitdiff
Merge pull request #224 from RicterZ/pull/221
authorRicter Zheng <RicterZheng@gmail.com>
Mon, 7 Jun 2021 09:21:00 +0000 (17:21 +0800)
committerGitHub <noreply@github.com>
Mon, 7 Jun 2021 09:21:00 +0000 (17:21 +0800)
Pull/221

1  2 
nhentai/doujinshi.py
nhentai/utils.py

index 6ff7edb58a74f08a8d1443d16b3d565048b6dd3a,3dea1044daf2aae62adf82f4f8765242cf732aaf..8d00e43caf3118c0f76f5182f5369c1bd8d9ee16
@@@ -70,9 -69,15 +71,9 @@@ class Doujinshi(object)
                  logger.warning('Page count and ext count do not equal')
  
              for i in range(1, min(self.pages, len(self.ext)) + 1):
-                 download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i, self.ext[i-1]))
+                 download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i, self.ext[i - 1]))
  
              self.downloader.download(download_queue, self.filename)
 -
 -            '''
 -            for i in range(len(self.ext)):
 -                download_queue.append('%s/%d/%d.%s' % (IMAGE_URL, int(self.img_id), i+1, EXT_MAP[self.ext[i]]))
 -            '''
 -
          else:
              logger.critical('Downloader has not been loaded')
  
index eeae3de694b77d78cb3efccc16189d26aaf9c763,f7532bf12e3900bbde6683f49fd5b9676d2fe2ee..e0a5b4d087bffe9fb549a61c340a70c9f135e40a
@@@ -251,8 -252,9 +252,8 @@@ def format_filename(s)
      """
      # maybe you can use `--format` to select a suitable filename
      ban_chars = '\\\'/:,;*?"<>|\t'
-     filename = s.translate(str.maketrans(ban_chars, ' '*len(ban_chars))).strip()
+     filename = s.translate(str.maketrans(ban_chars, ' ' * len(ban_chars))).strip()
      filename = ' '.join(filename.split())
 -    print(repr(filename))
  
      while filename.endswith('.'):
          filename = filename[:-1]