x_
Browse files
Client/Extract Pixiv/ai_search.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
import asyncio
|
| 3 |
import sys
|
|
|
|
| 4 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 5 |
from pixiv_api import search, cookies, headers
|
| 6 |
|
|
@@ -10,10 +11,17 @@ input_url = input("Enter the URL: ")
|
|
| 10 |
|
| 11 |
pages = 15
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
async def main():
|
| 14 |
post_ids, filename = await search(input_url, pages, ai_only=True, real_only=False, cookies=cookies, headers=headers)
|
| 15 |
post_ids = list(dict.fromkeys(post_ids))
|
| 16 |
-
with open(f"../{filename}.txt", "w") as f:
|
| 17 |
f.write("\n".join(map(str, post_ids)))
|
| 18 |
|
| 19 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import os
|
| 2 |
import asyncio
|
| 3 |
import sys
|
| 4 |
+
import time
|
| 5 |
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 6 |
from pixiv_api import search, cookies, headers
|
| 7 |
|
|
|
|
| 11 |
|
| 12 |
pages = 15
|
| 13 |
|
| 14 |
+
x=''
|
| 15 |
+
n=int(time.time()*100)
|
| 16 |
+
while n:
|
| 17 |
+
x=chr(97+n%26)+x
|
| 18 |
+
n//=26
|
| 19 |
+
|
| 20 |
+
|
| 21 |
async def main():
|
| 22 |
post_ids, filename = await search(input_url, pages, ai_only=True, real_only=False, cookies=cookies, headers=headers)
|
| 23 |
post_ids = list(dict.fromkeys(post_ids))
|
| 24 |
+
with open(f"../{x}_{filename}.txt", "w") as f:
|
| 25 |
f.write("\n".join(map(str, post_ids)))
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
Client/Extract Pixiv/pixiv_api.py
CHANGED
|
@@ -179,7 +179,7 @@ async def process_post(post_id, session, semaphore):
|
|
| 179 |
return post_id, image_url
|
| 180 |
|
| 181 |
return post_id, None
|
| 182 |
-
except:
|
| 183 |
return post_id, None
|
| 184 |
|
| 185 |
async def get_pixif_data(post_ids):
|
|
|
|
| 179 |
return post_id, image_url
|
| 180 |
|
| 181 |
return post_id, None
|
| 182 |
+
except Exception:
|
| 183 |
return post_id, None
|
| 184 |
|
| 185 |
async def get_pixif_data(post_ids):
|