mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 09:50:20 +08:00
do not override previous
This commit is contained in:
parent
aa9cf29755
commit
7a39415c5e
2
.github/workflows/docker-publish.yml
vendored
2
.github/workflows/docker-publish.yml
vendored
@ -93,7 +93,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: error-screenshots
|
name: error-screenshots
|
||||||
path: ./errors
|
path: ./errors/*
|
||||||
|
|
||||||
# Sign the resulting Docker image digest except on PRs.
|
# Sign the resulting Docker image digest except on PRs.
|
||||||
# This will only write to the public Rekor transparency log when the Docker
|
# This will only write to the public Rekor transparency log when the Docker
|
||||||
|
6
main.py
6
main.py
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import uvicorn
|
import uvicorn
|
||||||
import uvicorn.config
|
import uvicorn.config
|
||||||
@ -39,7 +40,10 @@ async def read_item(request: LinkRequest):
|
|||||||
try:
|
try:
|
||||||
challenged = await asyncio.wait_for(bypass_cloudflare(page), timeout=timeout)
|
challenged = await asyncio.wait_for(bypass_cloudflare(page), timeout=timeout)
|
||||||
except asyncio.TimeoutError as e:
|
except asyncio.TimeoutError as e:
|
||||||
await page.save_screenshot("errors/error.png")
|
i = 0
|
||||||
|
while Path(f"errors/error{i}.png").is_file():
|
||||||
|
i += 1
|
||||||
|
await page.save_screenshot(f"errors/error{i}.png")
|
||||||
raise HTTPException(detail="Timeout", status_code=408) from e
|
raise HTTPException(detail="Timeout", status_code=408) from e
|
||||||
|
|
||||||
logger.info(f"Got webpage: {request.url}")
|
logger.info(f"Got webpage: {request.url}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user