6
6
import sys
7
7
import inquirer
8
8
9
- version = "1.5 .0"
9
+ version = "1.6 .0"
10
10
11
11
if os .name == 'nt' :
12
12
from ctypes import windll
15
15
proxy_list = []
16
16
header = {"User-Agent" :f"nn-downloader/{ version } (by Official Husko on GitHub)" }
17
17
needed_folders = ["db" , "media" ]
18
- database_list = ["e621" , "furbooru" , "rule34" , "e6ai" ]
18
+ database_list = ["e621" , "furbooru" , "rule34" , "e6ai" , "e926" ]
19
19
unsafe_chars = ["/" , "\\ " , ":" , "*" , "?" , "\" " , "<" , ">" , "|" , "\0 " , "$" , "#" , "@" , "&" , "%" , "!" , "`" , "^" , "(" , ")" , "{" , "}" , "[" , "]" , "=" , "+" , "~" , "," , ";" ]
20
20
21
21
if sys .gettrace () is not None :
@@ -69,6 +69,7 @@ def clear_screen():
69
69
oneTimeDownload = config ["oneTimeDownload" ]
70
70
use_proxies = config ["proxies" ]
71
71
checkForUpdates = config ["checkForUpdates" ]
72
+ ai_training = config ["ai_training" ]
72
73
else :
73
74
config = Config_Manager .creator ()
74
75
print (colored ("New Config file generated. Please configure it for your use case and add API keys for needed services." , "green" ))
@@ -106,10 +107,9 @@ def clear_screen():
106
107
107
108
site = answers .get ("selection" ).lower ()
108
109
109
- if site in ["multporn" , "yiffer" , "luscious" ]:
110
- pass
111
- else :
112
- print (colored ("Please enter the tags you want to use" , "green" ))
110
+ if site in ["e621" , "e6ai" , "e926" ]:
111
+
112
+ print (colored ("Please enter the tags you want to use." , "green" ))
113
113
user_tags = input (">> " ).lower ()
114
114
while user_tags == "" :
115
115
print (colored ("Please enter the tags you want." , "red" ))
@@ -121,42 +121,17 @@ def clear_screen():
121
121
max_sites = input (">> " ).lower ()
122
122
print ("" )
123
123
124
- if site == "e621" :
125
- apiUser = config ["user_credentials" ]["e621" ]["apiUser" ]
126
- apiKey = config ["user_credentials" ]["e621" ]["apiKey" ]
127
- if oneTimeDownload == True :
128
- with open ("db/e621.db" , "r" ) as db_reader :
129
- database = db_reader .read ().splitlines ()
130
- if apiKey == "" or apiUser == "" :
131
- print (colored ("Please add your Api Key into the config.json" , "red" ))
132
- sleep (5 )
133
- else :
134
- output = E621 .Fetcher (user_tags = user_tags , user_blacklist = config ["blacklisted_tags" ], proxy_list = proxy_list , max_sites = max_sites , user_proxies = config ["proxies" ], apiUser = apiUser , apiKey = apiKey , header = header , db = database )
135
-
136
- if site == "e6ai" :
137
- apiUser = config ["user_credentials" ]["e6ai" ]["apiUser" ]
138
- apiKey = config ["user_credentials" ]["e6ai" ]["apiKey" ]
139
- if oneTimeDownload == True :
140
- with open ("db/e6ai.db" , "r" ) as db_reader :
141
- database = db_reader .read ().splitlines ()
142
- if apiKey == "" or apiUser == "" :
143
- print (colored ("Please add your Api Key into the config.json" , "red" ))
144
- sleep (5 )
145
- else :
146
- output = E6AI .Fetcher (user_tags = user_tags , user_blacklist = config ["blacklisted_tags" ], proxy_list = proxy_list , max_sites = max_sites , user_proxies = config ["proxies" ], apiUser = apiUser , apiKey = apiKey , header = header , db = database )
147
-
148
- elif site == "e926" :
149
- apiUser = config ["user_credentials" ]["e926" ]["apiUser" ]
150
- apiKey = config ["user_credentials" ]["e926" ]["apiKey" ]
124
+ apiUser = config ["user_credentials" ][site ]["apiUser" ]
125
+ apiKey = config ["user_credentials" ][site ]["apiKey" ]
151
126
if oneTimeDownload == True :
152
- with open ("db/e621 .db" , "r" ) as db_reader :
127
+ with open (f "db/{ site } .db" , "r" ) as db_reader :
153
128
database = db_reader .read ().splitlines ()
154
129
if apiKey == "" or apiUser == "" :
155
130
print (colored ("Please add your Api Key into the config.json" , "red" ))
156
131
sleep (5 )
157
132
else :
158
- output = E926 .Fetcher (user_tags = user_tags , user_blacklist = config ["blacklisted_tags" ], proxy_list = proxy_list , max_sites = max_sites , user_proxies = config ["proxies" ], apiUser = apiUser , apiKey = apiKey , header = header , db = database )
159
-
133
+ output = E6System .Fetcher (user_tags = user_tags , user_blacklist = config ["blacklisted_tags" ], proxy_list = proxy_list , max_sites = max_sites , user_proxies = config ["proxies" ], apiUser = apiUser , apiKey = apiKey , header = header , db = database , site = site , ai_training = ai_training )
134
+
160
135
elif site == "rule34" :
161
136
if oneTimeDownload == True :
162
137
with open ("db/rule34.db" , "r" ) as db_reader :
0 commit comments