Skip to content

Commit a36a218

Browse files
committed
Fix YAML syntax in GitHub workflow and update crawler base functionality
1 parent 3a977de commit a36a218

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/python-app.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- uses: actions/checkout@v3
1514
- name: Set up Python

backend/crawlers/base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import logging
1010
import time
1111
import json
12+
import ssl
1213
from abc import ABC, abstractmethod
1314
from functools import wraps
1415
from typing import Dict, Any, Optional, AsyncGenerator, Callable, TypeVar, Union, Set, List
@@ -32,6 +33,11 @@
3233

3334
T = TypeVar('T')
3435

36+
# Create a custom SSL context that doesn't verify certificates
37+
# This is necessary for development environments with SSL certificate issues
38+
ssl_context = ssl.create_default_context()
39+
ssl_context.check_hostname = False
40+
ssl_context.verify_mode = ssl.CERT_NONE
3541

3642
def api_retry(config: Optional[CrawlerConfig] = None) -> Callable:
3743
"""
@@ -202,8 +208,10 @@ async def __aenter__(self):
202208
Self instance for context manager use
203209
"""
204210
if not self.session:
205-
logger.debug(f"{self.__class__.__name__}: Creating new aiohttp session")
206-
self.session = aiohttp.ClientSession(headers=self.headers)
211+
logger.debug(f"{self.__class__.__name__}: Creating new aiohttp session with SSL verification disabled")
212+
# Use the custom SSL context that doesn't verify certificates
213+
conn = aiohttp.TCPConnector(ssl=ssl_context)
214+
self.session = aiohttp.ClientSession(headers=self.headers, connector=conn)
207215
return self
208216

209217
async def __aexit__(self, exc_type, exc_val, exc_tb):

0 commit comments

Comments
 (0)