Fix: Catch all Playwright errors for curl fallback
ImportError only catches import failures. Browser launch errors (executable not found) are runtime exceptions. Changed to catch all Exception types to properly fallback to curl.
This commit is contained in:
@@ -393,8 +393,8 @@ class KikV2ApiClient:
|
||||
|
||||
logger.info(f"KikV2ApiClient: Retrieved content via Playwright, length: {len(html_content)}")
|
||||
|
||||
except ImportError:
|
||||
logger.info("KikV2ApiClient: Playwright not available, falling back to curl")
|
||||
except Exception as playwright_error:
|
||||
logger.info(f"KikV2ApiClient: Playwright failed ({type(playwright_error).__name__}: {str(playwright_error)[:100]}), falling back to curl")
|
||||
# Fallback to curl (bypasses Python SSL issues with legacy servers)
|
||||
curl_path = shutil.which('curl')
|
||||
if not curl_path:
|
||||
|
||||
Reference in New Issue
Block a user