我正在使用Retrieve_Report下载数据分析。然后它返回可用报告类型的列表,如下所示:
name reporting type: content_owner_basic_a3
name reporting type: content_owner_estimated_revenue_a1
name reporting type: content_owner_asset_province_a2
name reporting type: content_owner_asset_playback_location_a2
name reporting type: content_owner_asset_basic_a2
name reporting type: content_owner_asset_demographics_a1
name reporting type: content_owner_demographics_a1
name reporting type: content_owner_asset_cards_a1
name reporting type: content_owner_cards_a1
name reporting type: content_owner_asset_traffic_source_a2
name reporting type: content_owner_asset_sharing_service_a1
name reporting type: content_owner_traffic_source_a2
name reporting type: content_owner_device_os_a2
name reporting type: content_owner_playlist_combined_a1
name reporting type: content_owner_playback_location_a2
name reporting type: content_owner_subtitles_a2
name reporting type: content_owner_playlist_device_os_a1
name reporting type: content_owner_end_screens_a1
name reporting type: content_owner_annotations_a1
name reporting type: content_owner_ad_rates_a1
name reporting type: content_owner_playlist_basic_a1
name reporting type: content_owner_sharing_service_a1
name reporting type: content_owner_asset_end_screens_a1
name reporting type: content_owner_asset_device_os_a2
name reporting type: content_owner_province_a2
name reporting type: content_owner_playlist_traffic_source_a1
name reporting type: content_owner_playlist_playback_location_a1
name reporting type: content_owner_asset_estimated_revenue_a1
name reporting type: content_owner_combined_a2
name reporting type: content_owner_asset_annotations_a1
name reporting type: content_owner_asset_combined_a2
name reporting type: content_owner_playlist_province_a1
问题是它看起来像 Retrieve_Report无法获取名为 content_owner_ad_revenue_raw_a1 和 content_owner_video_metadata_a2/content_owner_video_metadata_a1 的报告类型。有没有办法从这些报告类型下载数据?
这些是系统管理的报告。
您需要将 includeSystemManaged=True
添加为 .list()
的参数。在code sample you linked的背景下,修改第 152-158 行,如下所示:
try:
# If the user has not specified a job ID or report URL, retrieve a list
# of available jobs and prompt the user to select one.
if not args.job_id and not args.report_url:
if list_reporting_jobs(youtube_reporting,
onBehalfOfContentOwner=args.content_owner
includeSystemManaged=True):
args.job_id = get_job_id_from_user()
如果您直接调用 list()
函数,
youtube_reporting.jobs().list(onBehalfOfContentOwner={your_content_owner_id}, includeSystemManaged=True).execute()
我是一名优秀的程序员,十分优秀!