]> git.lizzy.rs Git - nhentai.git/commitdiff
slow down #50
authorRicterZ <ricterzheng@gmail.com>
Sat, 4 May 2019 04:12:57 +0000 (12:12 +0800)
committerRicterZ <ricterzheng@gmail.com>
Sat, 4 May 2019 04:12:57 +0000 (12:12 +0800)
nhentai/command.py
nhentai/doujinshi.py
nhentai/parser.py

index c7fa00d36bbf55cd91a7b729db7634b8e57149d8..a325f64728e35b4694d81a1c1d3dd5cd7bfaf0e6 100644 (file)
@@ -26,10 +26,14 @@ def main():
         logger.info('Logging in to nhentai using credential pair \'%s:%s\'' % (username, '*' * len(password)))
         login(username, password)
 
-        if options.is_download:
+        if options.is_download or options.is_show:
             for doujinshi_info in login_parser():
                 doujinshi_list.append(Doujinshi(**doujinshi_info))
 
+            if options.is_show and not options.is_download:
+                print_doujinshi([{'id': i.id, 'title': i.name} for i in doujinshi_list])
+                exit(0)
+
     if options.tag:
         doujinshis = tag_parser(options.tag, max_page=options.max_page)
         print_doujinshi(doujinshis)
@@ -38,6 +42,7 @@ def main():
 
     if options.keyword:
         doujinshis = search_parser(options.keyword, options.page)
+        print(doujinshis)
         print_doujinshi(doujinshis)
         if options.is_download:
             doujinshi_ids = map(lambda d: d['id'], doujinshis)
index 6cb17e8dacf3eaecf1038ef4c21cb7979a12e195..88e092538ce55befd6facdf9fcce342cde108950 100644 (file)
@@ -48,7 +48,7 @@ class Doujinshi(object):
             ["Characters", self.info.character],
             ["Authors", self.info.artist],
             ["Language", self.info.language],
-            ["Tags", ', '.join(self.info.tag.keys())],
+            ["Tags", self.info.tags],
             ["URL", self.url],
             ["Pages", self.pages],
         ]
index a753b33e1f9cd63026f58ce24ede679e01e3ace5..9feb89ca554e34c282b7335768561e94885197fd 100644 (file)
@@ -95,7 +95,7 @@ def login_parser():
         ret.append(result)
 
     # TODO: reduce threads number ...
-    thread_pool = threadpool.ThreadPool(3)
+    thread_pool = threadpool.ThreadPool(1)
 
     for page in range(1, pages + 1):
         try: