+ if 'You\'re loading pages way too quickly.' in resp.text or 'Really, slow down' in resp.text:
+ logger.error('Using nhentai --cookie \'YOUR_COOKIE_HERE\' to save your Cookie.')
+ exit(2)
+
+
+def _get_title_and_id(response):
+ result = []
+ html = BeautifulSoup(response, 'html.parser')
+ doujinshi_search_result = html.find_all('div', attrs={'class': 'gallery'})
+ for doujinshi in doujinshi_search_result:
+ doujinshi_container = doujinshi.find('div', attrs={'class': 'caption'})
+ title = doujinshi_container.text.strip()
+ title = title if len(title) < 85 else title[:82] + '...'
+ id_ = re.search('/g/(\d+)/', doujinshi.a['href']).group(1)
+ result.append({'id': id_, 'title': title})
+
+ return result
+
+
+def favorites_parser(page=None):
+ result = []
+ html = BeautifulSoup(request('get', constant.FAV_URL).content, 'html.parser')