fix(insta-lab): replace Google Trends with YouTube Data API (Google API 폐기 대응)
Google이 비공식 trends endpoint 두 가지(/trends/.../rss + /trends/api/dailytrends) 모두 404로 폐기 (NAS에서 직접 호출 시 확정). 대안으로 YouTube Data API v3 mostPopular(regionCode=KR, 50개)로 source 교체: - source 이름: google_trends → youtube_trending - 키워드: 영상 제목 정제 (대괄호·이모지 제거, 60자 limit) - API 키: YOUTUBE_DATA_API_KEY (agent-office와 공유, .env 그대로 활용) - 키 미설정 시 graceful skip - docker-compose insta-lab에 환경변수 추가 - 테스트 9/9 pass (기존 6 + youtube 3 신규)
This commit is contained in:
@@ -59,7 +59,7 @@ def test_collect_trends_kicks_background(client, monkeypatch):
|
||||
|
||||
def fake_collect_all(cats):
|
||||
captured["called"] = True
|
||||
return {"naver_popular": 3, "google_trends": 2}
|
||||
return {"naver_popular": 3, "youtube_trending": 2}
|
||||
|
||||
monkeypatch.setattr(trend_collector, "collect_all", fake_collect_all)
|
||||
resp = client.post("/api/insta/trends/collect", json={})
|
||||
|
||||
Reference in New Issue
Block a user