diff --git a/bots/publisher_bot.py b/bots/publisher_bot.py index f909a06..edfaf47 100644 --- a/bots/publisher_bot.py +++ b/bots/publisher_bot.py @@ -211,6 +211,7 @@ def _is_platform_logo(image_url: str) -> bool: skip_patterns = [ 'logo', 'icon', 'avatar', 'banner', '/ad/', 'google.com/images/branding', 'googlenews', 'google-news', + 'lh3.googleusercontent.com', # Google News CDN 썸네일 'facebook.com', 'twitter.com', 'naver.com/favicon', 'default_image', 'placeholder', 'noimage', 'no-image', 'og-default', 'share-default', 'sns_', 'common/', @@ -223,11 +224,11 @@ def _fetch_og_image(url: str) -> str: """원본 기사 URL에서 og:image 메타태그 크롤링""" if not url or not url.startswith('http'): return '' - # Google 뉴스 리다이렉트인 경우 실제 기사 URL 추출 시도 + # Google 뉴스 리다이렉트인 경우 실제 기사 URL 추출 시도 (head는 리다이렉트 안됨 → get 사용) if 'news.google.com' in url: try: - resp = requests.head(url, timeout=10, allow_redirects=True, - headers={'User-Agent': 'Mozilla/5.0'}) + resp = requests.get(url, timeout=15, allow_redirects=True, + headers={'User-Agent': 'Mozilla/5.0 (compatible; BlogBot/1.0)'}) if resp.url and 'news.google.com' not in resp.url: url = resp.url except Exception: