mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-19 18:31:24 +02:00
update usages
This commit is contained in:
parent
0d185f465d
commit
16d3b555c9
@ -1,6 +1,5 @@
|
|||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- os x
|
|
||||||
|
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
@ -14,5 +13,5 @@ install:
|
|||||||
- python setup.py install
|
- python setup.py install
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- NHENTAI=nhentai.net nhentai --search umaru
|
- NHENTAI=https://nhentai.net nhentai --search umaru
|
||||||
- NHENTAI=nhentai.net nhentai --ids=152503,146134 -t 10 --download --path=/tmp/
|
- NHENTAI=https://nhentai.net nhentai --id=152503,146134 -t 10 --path=/tmp/
|
||||||
|
23
README.md
23
README.md
@ -18,16 +18,10 @@ nhentai
|
|||||||
|
|
||||||
|
|
||||||
### 用法
|
### 用法
|
||||||
+ 下载指定 id 的本子:
|
|
||||||
|
|
||||||
|
|
||||||
nhentai --id=123855
|
|
||||||
|
|
||||||
|
|
||||||
+ 下载指定 id 列表的本子:
|
+ 下载指定 id 列表的本子:
|
||||||
|
|
||||||
|
|
||||||
nhentai --ids=123855,123866
|
nhentai --id=123855,123866
|
||||||
|
|
||||||
|
|
||||||
+ 下载某关键词第一页的本子(不推荐):
|
+ 下载某关键词第一页的本子(不推荐):
|
||||||
@ -36,10 +30,17 @@ nhentai
|
|||||||
nhentai --search="tomori" --page=1 --download
|
nhentai --search="tomori" --page=1 --download
|
||||||
|
|
||||||
|
|
||||||
`-t, --thread` 指定下载的线程数,最多为 10 线程。
|
`-t, --thread`:指定下载的线程数,最多为 10 线程。
|
||||||
`--path` 指定下载文件的输出路径,默认为当前目录。
|
`--path`:指定下载文件的输出路径,默认为当前目录。
|
||||||
`--timeout` 指定下载图片的超时时间,默认为 30 秒。
|
`--timeout`:指定下载图片的超时时间,默认为 30 秒。
|
||||||
`--proxy` 指定下载的代理,例如: http://127.0.0.1:8080/
|
`--proxy`:指定下载的代理,例如: http://127.0.0.1:8080/
|
||||||
|
|
||||||
|
### 自建 nhentai 镜像
|
||||||
|
如果想用自建镜像下载 nhentai 的本子,需要搭建 nhentai.net 和 i.nhentai.net 的反向代理。
|
||||||
|
例如用 h.loli.club 来做反向代理的话,需要 h.loli.club 反代 nhentai.net,i.h.loli.club 反带 i.nhentai.net。
|
||||||
|
然后利用环境变量来下载:
|
||||||
|
|
||||||
|
NHENTAI=http://h.loli.club nhentai --id 123456
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 541 KiB After Width: | Height: | Size: 189 KiB |
Binary file not shown.
Before Width: | Height: | Size: 658 KiB After Width: | Height: | Size: 173 KiB |
@ -7,10 +7,12 @@ from nhentai.parser import doujinshi_parser, search_parser, print_doujinshi
|
|||||||
from nhentai.doujinshi import Doujinshi
|
from nhentai.doujinshi import Doujinshi
|
||||||
from nhentai.downloader import Downloader
|
from nhentai.downloader import Downloader
|
||||||
from nhentai.logger import logger
|
from nhentai.logger import logger
|
||||||
|
from nhentai.constant import BASE_URL
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
banner()
|
banner()
|
||||||
|
logger.info('Using mirror: {0}'.format(BASE_URL))
|
||||||
options = cmd_parser()
|
options = cmd_parser()
|
||||||
|
|
||||||
doujinshi_ids = []
|
doujinshi_ids = []
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
import os
|
import os
|
||||||
|
import urlparse
|
||||||
|
|
||||||
BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
|
BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
|
||||||
|
|
||||||
DETAIL_URL = '%s/g' % BASE_URL
|
DETAIL_URL = '%s/g' % BASE_URL
|
||||||
SEARCH_URL = '%s/search/' % BASE_URL
|
SEARCH_URL = '%s/search/' % BASE_URL
|
||||||
IMAGE_URL = 'https://i.%s/galleries' % BASE_URL
|
|
||||||
|
u = urlparse.urlparse(BASE_URL)
|
||||||
|
IMAGE_URL = '%s://i.%s/galleries' % (u.scheme, u.hostname)
|
||||||
|
|
||||||
PROXY = {}
|
PROXY = {}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
from builtins import range
|
# from builtins import range
|
||||||
|
|
||||||
from nhentai.constant import DETAIL_URL, IMAGE_URL
|
from nhentai.constant import DETAIL_URL, IMAGE_URL
|
||||||
from nhentai.logger import logger
|
from nhentai.logger import logger
|
||||||
|
Loading…
x
Reference in New Issue
Block a user