diff --git a/.travis.yml b/.travis.yml index 6b5330a..cdb9d4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,10 @@ install: script: - echo 268642 > /tmp/test.txt - - NHENTAI=https://nhentai.net nhentai --cookie '__cfduid=da09f237ceb0f51c75980b0b3fda3ce571558179357; _ga=GA1.2.2000087053.1558179358; _gid=GA1.2.782652201.1560348447; csrftoken=E2O8wfriFkcXUgN1AC41DoLqfRaBbggIUdvy46yC45PKCRCmCHQHQ7YRUy0d7FXZ; sessionid=0rapzxkt6yl1wjhdxm9whtfdc7gvw0iu' - - NHENTAI=https://nhentai.net nhentai --search umaru - - NHENTAI=https://nhentai.net nhentai --id=152503,146134 -t 10 --output=/tmp/ --cbz - - NHENTAI=https://nhentai.net nhentai --tag lolicon - - NHENTAI=https://nhentai.net nhentai -F - - NHENTAI=https://nhentai.net nhentai --file /tmp/test.txt + - nhentai --cookie "csrftoken=3c4Mzn4f6NAI1awFqfIh495G3pv5Wade9n63Kx03mkSac8c2QR5vRR4jCwVzb3OR; sessionid=m034e2dyyxgbl9s07hbzgfhvadbap2tk" + - nhentai --search umaru + - nhentai --id=152503,146134 -t 10 --output=/tmp/ --cbz + - nhentai --tag lolicon + - nhentai -F + - nhentai --file /tmp/test.txt - nhentai --id=152503,146134 --gen-main --output=/tmp/ diff --git a/README.rst b/README.rst index 5369190..9c767e0 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ Set your nhentai cookie against captcha: .. code-block:: bash - nhentai --cookie 'YOUR COOKIE FROM nhentai.net' + nhentai --cookie "YOUR COOKIE FROM nhentai.net" Download specified doujinshi: diff --git a/nhentai/__init__.py b/nhentai/__init__.py index 8efd062..2bc558a 100644 --- a/nhentai/__init__.py +++ b/nhentai/__init__.py @@ -1,3 +1,3 @@ -__version__ = '0.3.5' +__version__ = '0.3.6' __author__ = 'RicterZ' __email__ = 'ricterzheng@gmail.com' diff --git a/nhentai/parser.py b/nhentai/parser.py index b96e707..cb53cc8 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -201,9 +201,9 @@ def tag_parser(tag_name, max_page=1): for p in range(1, max_page + 1): logger.debug('Fetching page {0} for doujinshi with tag \'{1}\''.format(p, tag_name)) - response = request('get', url='%s/%s?page=%d' % (constant.TAG_URL, tag_name, p)).content + response = request('get', url='%s/%s/?page=%d' % (constant.TAG_URL, tag_name, p)).content - result = _get_title_and_id(response) + result += _get_title_and_id(response) if not result: logger.error('Cannot find doujinshi id of tag \'{0}\''.format(tag_name)) return diff --git a/nhentai/utils.py b/nhentai/utils.py index 3bdf278..6a0d00b 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -168,7 +168,7 @@ def generate_main_html(output_dir='./'): def generate_cbz(output_dir='.', doujinshi_obj=None, rm_origin_dir=False): if doujinshi_obj is not None: doujinshi_dir = os.path.join(output_dir, doujinshi_obj.filename) - cbz_filename = os.path.join(os.path.join(doujinshi_dir, '..'), '%s.cbz' % doujinshi_obj.id) + cbz_filename = os.path.join(os.path.join(doujinshi_dir, '..'), '{}.cbz'.format(doujinshi_obj.filename)) else: cbz_filename = './doujinshi.cbz' doujinshi_dir = '.'