fix: source_image에도 플랫폼 로고 필터 적용 (근본 원인 수정)
NAS IP에서 Google News RSS URL이 200 응답하며 og:image에 lh3.googleusercontent.com 썸네일을 반환하는 문제. 두 곳 모두 차단: - fetch_featured_image(): source_image에 _is_platform_logo() 체크 추가 - _fetch_sources_content(): og:image 저장 전 플랫폼 로고 패턴 필터 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -262,9 +262,9 @@ def _fetch_og_image(url: str) -> str:
|
||||
|
||||
def fetch_featured_image(article: dict) -> str:
|
||||
"""대표 이미지: RSS 이미지 → og:image 크롤링 → Pexels 순으로 시도"""
|
||||
# 1) RSS 수집 시 가져온 소스 이미지
|
||||
# 1) RSS 수집 시 가져온 소스 이미지 (플랫폼 로고 제외)
|
||||
source_image = article.get('source_image', '')
|
||||
if source_image and source_image.startswith('http'):
|
||||
if source_image and source_image.startswith('http') and not _is_platform_logo(source_image):
|
||||
try:
|
||||
resp = requests.head(source_image, timeout=5, allow_redirects=True)
|
||||
if resp.status_code == 200:
|
||||
|
||||
Reference in New Issue
Block a user