]> git.lizzy.rs Git - nhentai.git/blobdiff - nhentai/constant.py
remove repeated spaces
[nhentai.git] / nhentai / constant.py
index 11f175c5005ac34cae88ccfccbd84242087f38fb..39c6f3e616b67f4cf878d348b971f954b8323a6a 100644 (file)
@@ -1,8 +1,38 @@
-SCHEMA = 'http://'
-# BASE_URL = 'nhentai.net'
-BASE_URL = 'nhentai.ricterz.me'
-URL = '%s%s' % (SCHEMA, BASE_URL)
-DETAIL_URL = '%s/g' % URL
-SEARCH_URL = '%s/search/' % URL
-IMAGE_URL = '%si.%s/galleries' % (SCHEMA, BASE_URL)
-PROXY = {}
+# coding: utf-8
+
+import os
+import tempfile
+
+try:
+    from urlparse import urlparse
+except ImportError:
+    from urllib.parse import urlparse
+
+
+BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
+
+__api_suspended_DETAIL_URL = '%s/api/gallery' % BASE_URL
+
+DETAIL_URL = '%s/g' % BASE_URL
+SEARCH_URL = '%s/api/galleries/search' % 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)
+
+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': '',
+}