Compare commits

..

9 Commits

Author SHA1 Message Date
8b8b5f193e 0.4.11 2021-01-11 11:15:21 +08:00
fc99d91ac1 fix #193 2021-01-11 11:14:35 +08:00
ba141efba7 remove repeated spaces 2021-01-11 11:04:29 +08:00
f78d8750f3 remove __future__ 2021-01-11 11:03:45 +08:00
af379c825c Merge branch 'master' into dev 2021-01-10 14:40:09 +08:00
2f9386f22c fix #188 2021-01-10 11:44:04 +08:00
24f79e0945 Merge pull request #190 from RicterZ/dev
fix bugs
2021-01-07 20:42:26 +08:00
edc46a9531 Merge pull request #189 from mobrine1/mobrine1-patch-1
Fixing loop when id not found, issue #188
2021-01-07 20:39:44 +08:00
72035a14e6 Fixing loop when id not found, issue #188 2021-01-07 07:32:29 -05:00
8 changed files with 13 additions and 12 deletions

View File

@ -1,3 +1,3 @@
__version__ = '0.4.10'
__version__ = '0.4.11'
__author__ = 'RicterZ'
__email__ = 'ricterzheng@gmail.com'

View File

@ -1,5 +1,5 @@
# coding: utf-8
from __future__ import print_function
import os
import sys
import json

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python2.7
# coding: utf-8
from __future__ import unicode_literals, print_function
import sys
import signal
import platform

View File

@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals, print_function
import os
import copy
import tempfile
try:

View File

@ -1,7 +1,6 @@
# coding: utf-8
from __future__ import print_function, unicode_literals
from tabulate import tabulate
from future.builtins import range
from nhentai.constant import DETAIL_URL, IMAGE_URL
from nhentai.logger import logger

View File

@ -1,5 +1,4 @@
# coding: utf-
from __future__ import unicode_literals, print_function
import multiprocessing
import signal

View File

@ -1,5 +1,4 @@
# coding: utf-8
from __future__ import unicode_literals, print_function
import os
import re
@ -116,8 +115,11 @@ def doujinshi_parser(id_):
try:
response = request('get', url)
if response.status_code in (200,):
if response.status_code in (200, ):
response = response.content
elif response.status_code in (404,):
logger.error("Doujinshi with id {0} cannot be found".format(id_))
return []
else:
logger.debug('Slow down and retry ({}) ...'.format(id_))
time.sleep(1)

View File

@ -1,5 +1,4 @@
# coding: utf-8
from __future__ import unicode_literals, print_function
import sys
import re
@ -240,8 +239,11 @@ def format_filename(s):
if filename include forbidden characters (\'/:,;*?"<>|) ,it replace space character(' ').
"""
# maybe you can use `--format` to select a suitable filename
ban_chars = '\\\'/:,;*?"<>|'
ban_chars = '\\\'/:,;*?"<>|\t'
filename = s.translate(str.maketrans(ban_chars, ' '*len(ban_chars))).strip()
filename = ' '.join(filename.split())
print(repr(filename))
while filename.endswith('.'):
filename = filename[:-1]