]> git.lizzy.rs Git - nhentai.git/commitdiff
modify tests #54 0.3.2
authorRicterZ <ricterzheng@gmail.com>
Sat, 18 May 2019 11:40:09 +0000 (19:40 +0800)
committerRicterZ <ricterzheng@gmail.com>
Sat, 18 May 2019 11:40:09 +0000 (19:40 +0800)
.travis.yml
nhentai/command.py

index e8a0921bf81267b80b68ad17e9fd6a10bf51f06f..b0b5eefeb67758eba1768d559009b046bdbc480a 100644 (file)
@@ -13,9 +13,9 @@ install:
 
 script:
     - echo 268642 > /tmp/test.txt
+    - NHENTAI=https://nhentai.net nhentai --cookie '__cfduid=da09f237ceb0f51c75980b0b3fda3ce571558179357; _ga=GA1.2.2000087053.1558179358; _gid=GA1.2.717818542.1558179358; csrftoken=iSxrTFOjrujJqauhAqWvTTI9dl3sfWnxdEFoMuqgmlBrbMin5Gj9wJW4r61cmH1X; sessionid=ewuaayfewbzpiukrarx9d52oxwlz2esd'
     - NHENTAI=https://nhentai.net nhentai --search umaru
-    - NHENTAI=https://nhentai.net nhentai --id=152503,146134 -t 10 --output=/tmp/
-    - NHENTAI=https://nhentai.net nhentai -l nhentai_test:nhentai --download --output=/tmp/
+    - NHENTAI=https://nhentai.net nhentai --id=152503,146134 -t 10 --output=/tmp/ --cbz
     - NHENTAI=https://nhentai.net nhentai --tag lolicon
-    - NHENTAI=https://nhentai.net nhentai --id 92066 --output=/tmp/ --cbz
+    - NHENTAI=https://nhentai.net nhentai -F
     - NHENTAI=https://nhentai.net nhentai --file /tmp/test.txt
index dc3ea9950fd6bebf5f9e7a7ac6666bc121de3503..55074cfd45a87a960014e818333d0a4c3c416869 100644 (file)
@@ -22,19 +22,15 @@ def main():
     doujinshi_list = []
 
     if options.favorites:
-        '''
-        username, password = options.login.split(':', 1)
-        logger.info('Logging in to nhentai using credential pair \'%s:%s\'' % (username, '*' * len(password)))
-        login(username, password)
-        '''
+        if not options.is_download:
+            logger.warning('You do not specify --download option')
 
-        if options.is_download or options.is_show:
-            for doujinshi_info in favorites_parser():
-                doujinshi_list.append(Doujinshi(**doujinshi_info))
+        for doujinshi_info in favorites_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 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)
@@ -44,7 +40,6 @@ 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)