Lowered bytes to read
Browse files- API/app.py +2 -3
API/app.py
CHANGED
|
@@ -160,7 +160,7 @@ def determine_exif_type(metadata):
|
|
| 160 |
|
| 161 |
async def get_exif(url, session):
|
| 162 |
start_range = 0
|
| 163 |
-
end_range =
|
| 164 |
|
| 165 |
headers = {
|
| 166 |
"Referer": "https://www.pixiv.net/",
|
|
@@ -226,11 +226,10 @@ async def download_image(session, post_id, post_url):
|
|
| 226 |
return (post_id, content)
|
| 227 |
|
| 228 |
async def generate_tar(posts, session):
|
| 229 |
-
loop = asyncio.get_event_loop()
|
| 230 |
tar_buffer = io.BytesIO()
|
| 231 |
tarf = tarfile.open(mode="w", fileobj=tar_buffer)
|
| 232 |
|
| 233 |
-
semaphore = asyncio.Semaphore(100)
|
| 234 |
|
| 235 |
async def add_to_tar(post_id, image_url):
|
| 236 |
async with semaphore:
|
|
|
|
| 160 |
|
| 161 |
async def get_exif(url, session):
|
| 162 |
start_range = 0
|
| 163 |
+
end_range = 512
|
| 164 |
|
| 165 |
headers = {
|
| 166 |
"Referer": "https://www.pixiv.net/",
|
|
|
|
| 226 |
return (post_id, content)
|
| 227 |
|
| 228 |
async def generate_tar(posts, session):
|
|
|
|
| 229 |
tar_buffer = io.BytesIO()
|
| 230 |
tarf = tarfile.open(mode="w", fileobj=tar_buffer)
|
| 231 |
|
| 232 |
+
semaphore = asyncio.Semaphore(100)
|
| 233 |
|
| 234 |
async def add_to_tar(post_id, image_url):
|
| 235 |
async with semaphore:
|