Reduce client to 8 workers
Browse files- Client/Extract Pixiv/ai_search.py +1 -1
- Client/Extract Pixiv/pixiv_api.py +6 -12
- Client/hunt.py +1 -1
Client/Extract Pixiv/ai_search.py
CHANGED
|
@@ -9,7 +9,7 @@ os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
|
| 9 |
|
| 10 |
input_url = input("Enter the URL: ")
|
| 11 |
|
| 12 |
-
pages =
|
| 13 |
|
| 14 |
x=''
|
| 15 |
n=int(time.time()*100)
|
|
|
|
| 9 |
|
| 10 |
input_url = input("Enter the URL: ")
|
| 11 |
|
| 12 |
+
pages = 30
|
| 13 |
|
| 14 |
x=''
|
| 15 |
n=int(time.time()*100)
|
Client/Extract Pixiv/pixiv_api.py
CHANGED
|
@@ -60,19 +60,13 @@ async def search(raw, pages, ai_only=True, real_only=True, cookies=None, headers
|
|
| 60 |
|
| 61 |
return post_ids, requests.utils.unquote(keywords, encoding='utf-8')
|
| 62 |
|
| 63 |
-
def base26(n):
|
| 64 |
-
if n == 0:
|
| 65 |
-
return "A"
|
| 66 |
-
|
| 67 |
-
b26 = ""
|
| 68 |
-
while n > 0:
|
| 69 |
-
n, remainder = divmod(n, 26)
|
| 70 |
-
b26 = chr(97 + remainder) + b26
|
| 71 |
-
|
| 72 |
-
return b26
|
| 73 |
-
|
| 74 |
def base26_time():
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
async def get_user(user_id, session):
|
| 78 |
data = await fetch_page(session, f'https://www.pixiv.net/ajax/user/{user_id}/profile/all')
|
|
|
|
| 60 |
|
| 61 |
return post_ids, requests.utils.unquote(keywords, encoding='utf-8')
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
def base26_time():
|
| 64 |
+
x=''
|
| 65 |
+
n=int(time.time()*100)
|
| 66 |
+
while n:
|
| 67 |
+
x=chr(97+n%26)+x
|
| 68 |
+
n//=26
|
| 69 |
+
return x
|
| 70 |
|
| 71 |
async def get_user(user_id, session):
|
| 72 |
data = await fetch_page(session, f'https://www.pixiv.net/ajax/user/{user_id}/profile/all')
|
Client/hunt.py
CHANGED
|
@@ -94,7 +94,7 @@ for index in indexs:
|
|
| 94 |
|
| 95 |
if to_download:
|
| 96 |
print(f"Total images to download: {len(to_download)}")
|
| 97 |
-
with ThreadPoolExecutor(max_workers=
|
| 98 |
list(tqdm(executor.map(download_image, to_download.items()), total=len(to_download), desc="Downloading"))
|
| 99 |
|
| 100 |
images_cache.update(os.listdir("images/Stash"))
|
|
|
|
| 94 |
|
| 95 |
if to_download:
|
| 96 |
print(f"Total images to download: {len(to_download)}")
|
| 97 |
+
with ThreadPoolExecutor(max_workers=8) as executor:
|
| 98 |
list(tqdm(executor.map(download_image, to_download.items()), total=len(to_download), desc="Downloading"))
|
| 99 |
|
| 100 |
images_cache.update(os.listdir("images/Stash"))
|