X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=nhentai%2Fconstant.py;h=bce3604f02f6639e887bd66df2625c0ff9e95236;hb=edc46a95315990ec3dec01258f379cde5625ca9e;hp=efd502279a22cde111a433f7b81f55bf93661f9c;hpb=0632826827535ed7ff885ca44c7054c261449733;p=nhentai.git diff --git a/nhentai/constant.py b/nhentai/constant.py index efd5022..bce3604 100644 --- a/nhentai/constant.py +++ b/nhentai/constant.py @@ -1,18 +1,39 @@ # coding: utf-8 from __future__ import unicode_literals, print_function import os -from nhentai.utils import urlparse +import copy +import tempfile + +try: + from urlparse import urlparse +except ImportError: + from urllib.parse import urlparse + BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net') -DETAIL_URL = '%s/api/gallery' % BASE_URL +__api_suspended_DETAIL_URL = '%s/api/gallery' % BASE_URL + +DETAIL_URL = '%s/g' % BASE_URL SEARCH_URL = '%s/api/galleries/search' % BASE_URL -TAG_URL = '%s/tag' % BASE_URL + + TAG_API_URL = '%s/api/galleries/tagged' % BASE_URL LOGIN_URL = '%s/login/' % BASE_URL +CHALLENGE_URL = '%s/challenge' % BASE_URL FAV_URL = '%s/favorites/' % BASE_URL u = urlparse(BASE_URL) IMAGE_URL = '%s://i.%s/galleries' % (u.scheme, u.hostname) -PROXY = {} +NHENTAI_HOME = os.path.join(os.getenv('HOME', tempfile.gettempdir()), '.nhentai') +NHENTAI_HISTORY = os.path.join(NHENTAI_HOME, 'history.sqlite3') +NHENTAI_CONFIG_FILE = os.path.join(NHENTAI_HOME, 'config.json') + + +CONFIG = { + 'proxy': {'http': '', 'https': ''}, + 'cookie': '', + 'language': '', + 'template': '', +}