docs YouTube Analytics API 수정 및 오디언스 인사이트 단위 수정
This commit is contained in:
1 parent
a1192193e5
commit
8fe0512608
4 files changed
+84
-42
No files matched your search
@@ -124,7 +124,7 @@ class YouTubeAnalyticsService:
|
||||
self._fetch_monthly_data(video_ids, previous_start, previous_end, access_token),
|
||||
self._fetch_top_videos(video_ids, start_date, _kpi_end, access_token),
|
||||
self._fetch_demographics(start_date, _kpi_end, access_token),
|
||||
self._fetch_region(video_ids, start_date, _kpi_end, access_token),
|
||||
self._fetch_region(start_date, _kpi_end, access_token),
|
||||
]
|
||||
else: # mode == "day"
|
||||
tasks = [
|
||||
@@ -134,7 +134,7 @@ class YouTubeAnalyticsService:
|
||||
self._fetch_daily_data(video_ids, day_previous_start, day_previous_end, access_token),
|
||||
self._fetch_top_videos(video_ids, start_date, end_date, access_token),
|
||||
self._fetch_demographics(start_date, end_date, access_token),
|
||||
self._fetch_region(video_ids, start_date, end_date, access_token),
|
||||
self._fetch_region(start_date, end_date, access_token),
|
||||
]
|
||||
|
||||
# 병렬 실행
|
||||
@@ -206,8 +206,6 @@ class YouTubeAnalyticsService:
|
||||
estimatedMinutesWatched, averageViewDuration,
|
||||
subscribersGained]
|
||||
|
||||
Note:
|
||||
annotationClickThroughRate는 2019년 annotations 기능 제거로 deprecated.
|
||||
"""
|
||||
logger.debug(
|
||||
f"[YouTubeAnalyticsService._fetch_kpi] START - video_count={len(video_ids)}"
|
||||
@@ -218,7 +216,7 @@ class YouTubeAnalyticsService:
|
||||
"startDate": start_date,
|
||||
"endDate": end_date,
|
||||
"metrics": "views,likes,comments,shares,estimatedMinutesWatched,averageViewDuration,subscribersGained",
|
||||
# "filters": f"video=={','.join(video_ids)}",
|
||||
"filters": f"video=={','.join(video_ids)}",
|
||||
}
|
||||
|
||||
result = await self._call_api(params, access_token)
|
||||
@@ -393,7 +391,6 @@ class YouTubeAnalyticsService:
|
||||
|
||||
async def _fetch_region(
|
||||
self,
|
||||
video_ids: list[str],
|
||||
start_date: str,
|
||||
end_date: str,
|
||||
access_token: str,
|
||||
@@ -403,7 +400,6 @@ class YouTubeAnalyticsService:
|
||||
지역별 조회수 분포를 조회합니다 (상위 5개).
|
||||
|
||||
Args:
|
||||
video_ids: YouTube 영상 ID 리스트
|
||||
start_date: 조회 시작일 (YYYY-MM-DD)
|
||||
end_date: 조회 종료일 (YYYY-MM-DD)
|
||||
access_token: OAuth 2.0 액세스 토큰
|
||||
@@ -421,9 +417,7 @@ class YouTubeAnalyticsService:
|
||||
"endDate": end_date,
|
||||
"dimensions": "country",
|
||||
"metrics": "views",
|
||||
"filters": f"video=={','.join(video_ids)}",
|
||||
"sort": "-views",
|
||||
"maxResults": "5",
|
||||
}
|
||||
|
||||
result = await self._call_api(params, access_token)
|
||||
|
||||
Reference in new issue
Block a user