From: Elias Fleckenstein Date: Sun, 8 May 2022 19:37:22 +0000 (+0200) Subject: Use ehentai.to / dogehls.xyz mirrors X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=HEAD;p=nhentai.git Use ehentai.to / dogehls.xyz mirrors --- diff --git a/nhentai/constant.py b/nhentai/constant.py index e100898..40f520c 100644 --- a/nhentai/constant.py +++ b/nhentai/constant.py @@ -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') diff --git a/nhentai/parser.py b/nhentai/parser.py index 3ebcabb..efd9318 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -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