Skip to content

[fix] Brunch·YouTube 링크 미리보기 수집 오류 수정 - #110

Open
vcz-Chan wants to merge 2 commits into
mainfrom
fix/brunch-og-preview
Open

[fix] Brunch·YouTube 링크 미리보기 수집 오류 수정#110
vcz-Chan wants to merge 2 commits into
mainfrom
fix/brunch-og-preview

Conversation

@vcz-Chan

@vcz-Chan vcz-Chan commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

📌 개요

Brunch와 YouTube 링크에서 제목·썸네일 미리보기가 비정상적으로 수집되는 문제를 수정합니다.

  • Brunch: 브라우저 User-Agent 요청이 Kakao 자동 로그인으로 리다이렉트되어 OG 문서에 도달하지 못함
  • YouTube: 운영 환경의 watch 페이지가 OG 메타데이터 대신 봇 확인 응답을 반환해 title이 - YouTube, thumbnailUrl이 null로 수집됨

Brunch 요청에는 서비스 식별 User-Agent를 사용하고, YouTube 링크만 공식 oEmbed 응답을 우선 사용하도록 분기합니다.

✅ 작업 내용 및 변경 사항

  • 링크 수집 User-Agent를 Promise9Bot/1.0으로 변경
  • youtube.com 및 youtu.be URL 판별 로직 추가
  • YouTube 미리보기·저장 수집 시 공식 oEmbed에서 제목과 썸네일 조회
  • oEmbed 응답의 제목 길이 및 썸네일 URL에 기존 검증 정책 적용
  • oEmbed 실패 또는 유효 데이터 부재 시 기존 OG 수집으로 폴백
  • User-Agent, YouTube preview/collect, OG 폴백 회귀 테스트 추가

💬 리뷰어에게

처리 범위

  • YouTube만 oEmbed로 분기합니다.
  • Instagram, Brunch 등 다른 도메인은 기존 OG 수집 경로를 유지합니다.
  • oEmbed가 제공하는 title과 thumbnail_url만 반영합니다.
  • description과 content는 추측해서 채우지 않고 null로 유지합니다.

구현 및 보안 고려

  • 프록시나 IP 우회는 사용하지 않습니다.
  • 요청 대상은 고정된 https://www.youtube.com/oembed 엔드포인트입니다.
  • 엔드포인트 DNS의 공개 IP 여부를 확인하고, 5초 타임아웃과 1MB 응답 제한을 적용합니다.
  • 썸네일도 기존 공개 HTTP(S) URL 검증과 최대 길이 제한을 통과한 경우에만 사용합니다.
  • oEmbed 장애가 전체 링크 수집 장애로 이어지지 않도록 일반 OG 수집으로 폴백합니다.

🧪 검증

  • 전체 테스트 241개 통과
  • ESLint 통과
  • TypeScript 빌드 통과
  • 실제 YouTube URL에서 제목·썸네일 미리보기 및 저장 수집 확인
  • 실제 Brunch URL에서 기존 OG 제목·썸네일 수집 확인

🔗 관련 이슈

없음

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T13:15:08.874449Z c467b49 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vcz-Chan vcz-Chan self-assigned this Sep 1, 2026
@vcz-Chan vcz-Chan changed the title [fix] 브런치 링크 미리보기 OG 수집 오류 수정 [fix] Brunch·YouTube 링크 미리보기 수집 오류 수정 Sep 1, 2026
@vcz-Chan
vcz-Chan force-pushed the fix/brunch-og-preview branch from dd58846 to 9ab7611 Compare September 1, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant