Merge pull request #223 from R0m1k3/antigravity

feat: Introduce BrowserlessService for persistent web scraping with e…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-02 14:00:33 +01:00
commit 7a06338313
3 files changed
+20 -3

No files matched your search

+2 -2
View File
@@ -541,10 +541,10 @@ class BrowserlessService:
# Take screenshot
screenshot_path = ""
try:
os.makedirs("/app/screenshots", exist_ok=True)
os.makedirs("screenshots", exist_ok=True)
timestamp = int(time.time() * 1000)
safe_name = "".join(c if c.isalnum() else "_" for c in url.split("//")[-1])[:50]
screenshot_path = f"/app/screenshots/{safe_name}_{timestamp}.jpg"
screenshot_path = f"screenshots/{safe_name}_{timestamp}.jpg"
is_amazon = "amazon" in url.lower() and "/dp/" in url
+1 -1
View File
@@ -139,7 +139,7 @@ async def process_item_check(item_id: int):
try:
import shutil
import os
dest_path = f"/app/screenshots/item_{item_id}.png"
dest_path = f"screenshots/item_{item_id}.png"
# Ensure directory exists
os.makedirs(os.path.dirname(dest_path), exist_ok=True)
shutil.copy2(screenshot_path, dest_path)