]> git.lizzy.rs Git - nhentai.git/commitdiff
Use ehentai.to / dogehls.xyz mirrors master
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 8 May 2022 19:37:22 +0000 (21:37 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 8 May 2022 19:37:22 +0000 (21:37 +0200)
nhentai/constant.py
nhentai/parser.py

index e100898ec92542ea035763e683bf1dcb56253f9b..40f520c6cfdb29e5f967f8c5235bfc40bc79cd07 100644 (file)
@@ -9,7 +9,7 @@ except ImportError:
     from urllib.parse import urlparse
 
 
-BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
+BASE_URL = os.getenv('NHENTAI', 'https://ehentai.to')
 
 __api_suspended_DETAIL_URL = '%s/api/gallery' % BASE_URL
 
@@ -22,8 +22,7 @@ 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)
+IMAGE_URL = 'https://t.dogehls.xyz/galleries'
 
 NHENTAI_HOME = os.path.join(os.getenv('HOME', tempfile.gettempdir()), '.nhentai')
 NHENTAI_HISTORY = os.path.join(NHENTAI_HOME, 'history.sqlite3')
index 3ebcabb1666c98dc0b4827ca9fd24365fa33de51..efd93184de6a4fe7ec6e98c6babc06166b2e4ab1 100644 (file)
@@ -133,7 +133,7 @@ def doujinshi_parser(id_):
     doujinshi_info = html.find('div', attrs={'id': 'info'})
 
     title = doujinshi_info.find('h1').text
-    pretty_name = doujinshi_info.find('h1').find('span', attrs={'class': 'pretty'}).text
+    pretty_name = doujinshi_info.find('h1').text
     subtitle = doujinshi_info.find('h2')
 
     doujinshi['name'] = title
@@ -156,9 +156,9 @@ def doujinshi_parser(id_):
     doujinshi['img_id'] = img_id.group(1)
     doujinshi['ext'] = ext
 
-    for _ in doujinshi_info.find_all('div', class_='tag-container field-name'):
-        if re.search('Pages:', _.text):
-            pages = _.find('span', class_='name').string
+    for _ in doujinshi_info.find_all('div'):
+        if re.search(' pages', _.text):
+            pages = _.text.replace(" pages", "")
     doujinshi['pages'] = int(pages)
 
     # gain information of the doujinshi