Cleanups for scrapers
This commit is contained in:
@@ -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']
|
||||
|
||||
@@ -878,7 +878,7 @@ function renderScrapersGrid(scrapers) {
|
||||
data.enabled ? '<span class="status-enabled">● Enabled</span>' :
|
||||
'<span class="status-disabled">○ 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">
|
||||
|
||||
Reference in New Issue
Block a user