Merge pull request #194 from RicterZ/dev

0.4.11
This commit is contained in:
Ricter Zheng 2021-01-11 11:16:09 +08:00 committed by GitHub
commit 7aedb905d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 10 deletions

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

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]