]> git.lizzy.rs Git - nhentai.git/blob - nhentai/constant.py
Add new option to avoid cloudflare captcha
[nhentai.git] / nhentai / constant.py
1 # coding: utf-8
2
3 import os
4 import tempfile
5
6 try:
7     from urlparse import urlparse
8 except ImportError:
9     from urllib.parse import urlparse
10
11
12 BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
13
14 __api_suspended_DETAIL_URL = '%s/api/gallery' % BASE_URL
15
16 DETAIL_URL = '%s/g' % BASE_URL
17 SEARCH_URL = '%s/api/galleries/search' % BASE_URL
18
19
20 TAG_API_URL = '%s/api/galleries/tagged' % BASE_URL
21 LOGIN_URL = '%s/login/' % BASE_URL
22 CHALLENGE_URL = '%s/challenge' % BASE_URL
23 FAV_URL = '%s/favorites/' % BASE_URL
24
25 u = urlparse(BASE_URL)
26 IMAGE_URL = '%s://i.%s/galleries' % (u.scheme, u.hostname)
27
28 NHENTAI_HOME = os.path.join(os.getenv('HOME', tempfile.gettempdir()), '.nhentai')
29 NHENTAI_HISTORY = os.path.join(NHENTAI_HOME, 'history.sqlite3')
30 NHENTAI_CONFIG_FILE = os.path.join(NHENTAI_HOME, 'config.json')
31
32 CONFIG = {
33     'proxy': {'http': '', 'https': ''},
34     'cookie': '',
35     'language': '',
36     'template': '',
37     'useragent': 'nhentai command line client (https://github.com/RicterZ/nhentai)'
38 }
39
40 LANGUAGEISO ={
41     'english' : 'en',
42     'chinese' : 'zh',
43     'japanese' : 'ja',
44     'translated' : 'translated'
45 }