RicterZ / nhentai

nhentai doujinshi downloader
http://nhentai.net
MIT License
838 stars 118 forks source link

Question about how to use the tool -- No result in response in page 1 #272

Closed Kayot closed 1 year ago

Kayot commented 1 year ago

The top half of this post is a question about how I'm handling the tool, the bottom half is the issue I'm having.

Side note, today's error has made me realize that I've been using this tool wrong. I was using a bash loop over the pages when I should have been using --page-range, though I think that command is newer than the bash loop. I was on version 4.17 before today and I think version 2.x when I wrote the script.

The command I've been using is;

#!/bin/bash

for ((i=1;i<=20;i++)); do
    nhentai --search="English" --page=$i --download --save-download-history -C --rm-origin-dir
done

mkdir -p $(date +%Y%m%d)
mv *.cbz $(date +%Y%m%d)

However recently (as of 20 mins ago) I had to add --sorting=recent otherwise the return was random.

#!/bin/bash

nhentai --search="English" --page-range=1-20 --download --save-download-history -C --rm-origin-dir --sorting=recent

mkdir -p $(date +%Y%m%d)
mv *.cbz $(date +%Y%m%d)

I was getting an error on page 1, 2 and 11. (see below the line break)

Now I'm going to use --page-range=1-20 but my goal is to just download the newest English releases, and then the newest Japanese releases. They end up in different dated folders. I've been using --search="English" and --search="Japanese" in that order to get these while relying on --save-download-history to keep from picking the same ones up. Is there a better way to do this?


I'm getting an error on a few pages;

kayot@core:/storage/Hentai/nHentai$ nhentai --search="English" --page-range=1-20 --dry-run --sorting=recent
[15:35:48] banner: nHentai ver 0.5.2: あなたも変態。 いいね?
[15:35:48] main: Using mirror: https://nhentai.net
[15:35:48] main: Using viewer template "default"
[15:35:49] check_cookie: Login successfully! Your username: kayot
[15:35:49] search_parser: Searching doujinshis using keywords "English" on page 1
[15:35:51] search_parser: No result in response in page 1
[15:35:51] search_parser: Searching doujinshis using keywords "English" on page 2
[15:35:54] search_parser: No result in response in page 2
[15:35:54] search_parser: Searching doujinshis using keywords "English" on page 3
[15:35:57] search_parser: Searching doujinshis using keywords "English" on page 4
[15:36:00] search_parser: Searching doujinshis using keywords "English" on page 5
[15:36:02] search_parser: Searching doujinshis using keywords "English" on page 6
[15:36:03] search_parser: Searching doujinshis using keywords "English" on page 7
[15:36:05] search_parser: Searching doujinshis using keywords "English" on page 8
[15:36:08] search_parser: Searching doujinshis using keywords "English" on page 9
[15:36:09] search_parser: Searching doujinshis using keywords "English" on page 10
[15:36:11] search_parser: Searching doujinshis using keywords "English" on page 11
[15:36:12] search_parser: No result in response in page 11
[15:36:12] search_parser: Searching doujinshis using keywords "English" on page 12
[15:36:14] search_parser: Searching doujinshis using keywords "English" on page 13
[15:36:16] search_parser: Searching doujinshis using keywords "English" on page 14
[15:36:18] search_parser: Searching doujinshis using keywords "English" on page 15
[15:36:20] search_parser: Searching doujinshis using keywords "English" on page 16
[15:36:21] search_parser: Searching doujinshis using keywords "English" on page 17
[15:36:23] search_parser: Searching doujinshis using keywords "English" on page 18
[15:36:24] search_parser: Searching doujinshis using keywords "English" on page 19
[15:36:26] search_parser: Searching doujinshis using keywords "English" on page 20
[15:36:27] print_doujinshi: Search Result || Found 425 doujinshis
<snip>

I was wondering why it's stating no results. I don't have a lot of experience with Python so I'm unsure of how to troubleshoot this in Visual Studio Code to give a more meaningful issue report.

Edit: My tag blacklists are males only. My artist blacklist is tokuni mirashichi. My Languages blacklist is chinese. Figured this might help.

RicterZ commented 1 year ago

First, I cannot reproducted the problem with above blacklists

$ python3 -m nhentai.command  --search="English" --page-range=1-20 --dry-run --sorting=recent
[18:43:29] banner: nHentai ver 0.5.2: あなたも変態。 いいね?
[18:43:29] main: Using mirror: https://nhentai.net
[18:43:29] main: Using proxy: http://127.0.0.1:7890
[18:43:29] main: Using viewer template "default"
[18:43:30] check_cookie: Login successfully! Your username: nhentai_test
[18:43:30] search_parser: Searching doujinshis using keywords "English" on page 1
[18:43:32] search_parser: Searching doujinshis using keywords "English" on page 2
[18:43:33] signal_handler: Ctrl-C signal received. Stopping...

I added debug log information on console output, you can set a env var via set DEBUG=1 to enable it It will print the request url and the response content.

Anyway, the recent sorting param of search API of nhentai.net maybe have bugs..

RicterZ commented 1 year ago

You can use --legacy option, please refer #277