]> git.lizzy.rs Git - nhentai.git/blob - nhentai/constant.py
bce3604f02f6639e887bd66df2625c0ff9e95236
[nhentai.git] / nhentai / constant.py
1 # coding: utf-8
2 from __future__ import unicode_literals, print_function
3 import os
4 import copy
5 import tempfile
6
7 try:
8     from urlparse import urlparse
9 except ImportError:
10     from urllib.parse import urlparse
11
12
13 BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
14
15 __api_suspended_DETAIL_URL = '%s/api/gallery' % BASE_URL
16
17 DETAIL_URL = '%s/g' % BASE_URL
18 SEARCH_URL = '%s/api/galleries/search' % BASE_URL
19
20
21 TAG_API_URL = '%s/api/galleries/tagged' % BASE_URL
22 LOGIN_URL = '%s/login/' % BASE_URL
23 CHALLENGE_URL = '%s/challenge' % BASE_URL
24 FAV_URL = '%s/favorites/' % BASE_URL
25
26 u = urlparse(BASE_URL)
27 IMAGE_URL = '%s://i.%s/galleries' % (u.scheme, u.hostname)
28
29 NHENTAI_HOME = os.path.join(os.getenv('HOME', tempfile.gettempdir()), '.nhentai')
30 NHENTAI_HISTORY = os.path.join(NHENTAI_HOME, 'history.sqlite3')
31 NHENTAI_CONFIG_FILE = os.path.join(NHENTAI_HOME, 'config.json')
32
33
34 CONFIG = {
35     'proxy': {'http': '', 'https': ''},
36     'cookie': '',
37     'language': '',
38     'template': '',
39 }