Cleanups for scrapers

This commit is contained in:
2026-04-10 10:04:20 -04:00
parent 0d5cc08bc0
commit 052a762182
15 changed files with 1411 additions and 567 deletions
+9
View File
@@ -13,6 +13,7 @@ from flask import Blueprint, jsonify, request
from src.database import get_database
from src.favorites import get_favorites_manager
from src.scraper_state import scraper_state
from src.discord_notifier import send_error_notification
api_bp = Blueprint('api', __name__)
@@ -796,6 +797,14 @@ def sync_extension_data():
db.update_product_price(product_id, new_price)
events_processed += 1
# Check for bot protection - extension explicitly reports when a check returned 0 products
if data.get('bot_protection_detected'):
send_error_notification(
"Pokemon Center extension detected possible bot protection — 0 products found on last check. "
"Check the extension tab manually and verify you can browse PokemonCenter.com.",
site="pokemoncenter"
)
# Update API stats
if 'apiStats' in data:
extension_data['api_stats'] = data['apiStats']
+1 -1
View File
@@ -878,7 +878,7 @@ function renderScrapersGrid(scrapers) {
data.enabled ? '<span class="status-enabled">&#9679; Enabled</span>' :
'<span class="status-disabled">&#9675; Disabled</span>'}
</div>
${data.last_run ? `<div class="scraper-last-run">Last: ${formatTime(new Date(data.last_run))}</div>` : ''}
<div class="scraper-last-run">Last: ${data.last_run ? formatTime(new Date(data.last_run)) : 'Never'}</div>
${data.last_error ? `<div class="scraper-error">${data.last_error}</div>` : ''}
</div>
<label class="toggle-switch">