Inceased up to limit
Browse files- API/app.py +1 -1
- Client/actual_size.py +8 -0
- Client/clear_images.py +7 -0
- Client/clear_texts.py +0 -3
- Client/show_all.py +0 -3
API/app.py
CHANGED
|
@@ -192,7 +192,7 @@ async def process_post(post_id, session, semaphore):
|
|
| 192 |
async with semaphore:
|
| 193 |
try:
|
| 194 |
data = await fetch_page(session, f"https://www.pixiv.net/ajax/illust/{post_id}/pages")
|
| 195 |
-
image_urls = [page['urls']['original'] for page in data['body'] if 'png' in page['urls']['original']][:
|
| 196 |
|
| 197 |
tasks = [get_exif(image_url, session) for image_url in image_urls]
|
| 198 |
exif_data_list = await asyncio.gather(*tasks)
|
|
|
|
| 192 |
async with semaphore:
|
| 193 |
try:
|
| 194 |
data = await fetch_page(session, f"https://www.pixiv.net/ajax/illust/{post_id}/pages")
|
| 195 |
+
image_urls = [page['urls']['original'] for page in data['body'] if 'png' in page['urls']['original']][:30]
|
| 196 |
|
| 197 |
tasks = [get_exif(image_url, session) for image_url in image_urls]
|
| 198 |
exif_data_list = await asyncio.gather(*tasks)
|
Client/actual_size.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import lmdb
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 5 |
+
db = lmdb.open("db", subdir=True, map_size=524288)
|
| 6 |
+
|
| 7 |
+
print(db.stat())
|
| 8 |
+
print(db.info())
|
Client/clear_images.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import shutil
|
| 3 |
+
|
| 4 |
+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 5 |
+
for folder in os.listdir('images'):
|
| 6 |
+
if folder != 'Stash':
|
| 7 |
+
shutil.rmtree(f"images/{folder}", ignore_errors=True)
|
Client/clear_texts.py
CHANGED
|
@@ -1,10 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
-
# import shutil
|
| 3 |
|
| 4 |
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 5 |
|
| 6 |
-
# shutil.rmtree("db", ignore_errors=True)
|
| 7 |
-
# shutil.rmtree("images", ignore_errors=True)
|
| 8 |
for file in os.listdir():
|
| 9 |
if file.endswith(".txt"):
|
| 10 |
os.rename(file, f"txt logs/{file}")
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
|
| 3 |
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
| 4 |
|
|
|
|
|
|
|
| 5 |
for file in os.listdir():
|
| 6 |
if file.endswith(".txt"):
|
| 7 |
os.rename(file, f"txt logs/{file}")
|
Client/show_all.py
CHANGED
|
@@ -14,13 +14,10 @@ with db.begin() as txn:
|
|
| 14 |
if value != b'\x00':
|
| 15 |
try:
|
| 16 |
key_str = key.decode('utf-8')
|
| 17 |
-
|
| 18 |
value_str = value.decode('utf-8')
|
| 19 |
|
| 20 |
int_part_str = value_str.split('p')[1].split('.')[0]
|
| 21 |
-
|
| 22 |
int_part = int(int_part_str)
|
| 23 |
-
|
| 24 |
items.append((key_str, int_part))
|
| 25 |
|
| 26 |
except (IndexError, ValueError) as e:
|
|
|
|
| 14 |
if value != b'\x00':
|
| 15 |
try:
|
| 16 |
key_str = key.decode('utf-8')
|
|
|
|
| 17 |
value_str = value.decode('utf-8')
|
| 18 |
|
| 19 |
int_part_str = value_str.split('p')[1].split('.')[0]
|
|
|
|
| 20 |
int_part = int(int_part_str)
|
|
|
|
| 21 |
items.append((key_str, int_part))
|
| 22 |
|
| 23 |
except (IndexError, ValueError) as e:
|