有什么方法可以通过API从YouTube视频中提取“最重播”(又称视频活动图)?
我指的是:
Is there any way to extract the "Most Replayed" (aka Video Activity Graph) Data from a YouTube video via API?
What I'm referring to:
YouTube Data API V3再一次没有提供基本功能。
我建议您尝试我的 youtube操作API 。的确,通过获取 https://yt.lemt.lemn.lemnife.com/videos.com/videos?part=mostreplayplayplayplay& amp; amp; amp; amp; amp; amp; amp; amp; amp; id = video_id ,您将在 item [“ mostreplayed”] 中获得最重播的图形值。
item [“ mostreplayed”]
带有视频ID xicrnilqgyc 您会得到:
xicrnilqgyc
{ "kind": "youtube#videoListResponse", "etag": "NotImplemented", "items": [ { "kind": "youtube#video", "etag": "NotImplemented", "id": "XiCrniLQGYc", "mostReplayed": { "markers": [ { "startMillis": 0, "intensityScoreNormalized": 1 }, { "startMillis": 2580, "intensityScoreNormalized": 0.7083409245967562 }, { "startMillis": 5160, "intensityScoreNormalized": 0.6381007317793738 }, ... { "startMillis": 255420, "intensityScoreNormalized": 0.012864077773078256 } ], "timedMarkerDecorations": [ { "visibleTimeRangeStartMillis": 0, "visibleTimeRangeEndMillis": 10320 } ] } } ] }
One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/videos?part=mostReplayed&id=VIDEO_ID, you will get the most replayed graph values you are looking for in item["mostReplayed"].
item["mostReplayed"]
With the video id XiCrniLQGYc you would get:
XiCrniLQGYc
将以下片段添加到分析/读取@benjamin的API响应。 此功能将为您提供视频中前5个片段(峰)。
def get_peak_rewatched_timestamps(test_data): markers = test_data['items'][0]['mostReplayed']['markers'] sorted_markers = sorted(markers, key=lambda x: x['intensityScoreNormalized'], reverse=True) top_markers = sorted_markers[:5] top_timestamps_seconds = [marker['startMillis'] / 1000 for marker in top_markers] return top_timestamps_seconds
Adding the following snippet to parse/read through @Benjamin's API response. This function will give you the top 5 snippets (peaks) from the video.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
YouTube Data API V3再一次没有提供基本功能。
我建议您尝试我的 youtube操作API 。的确,通过获取 https://yt.lemt.lemn.lemnife.com/videos.com/videos?part=mostreplayplayplayplay& amp; amp; amp; amp; amp; amp; amp; amp; amp; id = video_id ,您将在
item [“ mostreplayed”]
中获得最重播的图形值。带有视频ID
xicrnilqgyc
您会得到:One more time YouTube Data API v3 doesn't provide a basic feature.
I recommend you to try out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/videos?part=mostReplayed&id=VIDEO_ID, you will get the most replayed graph values you are looking for in
item["mostReplayed"]
.With the video id
XiCrniLQGYc
you would get:将以下片段添加到分析/读取@benjamin的API响应。
此功能将为您提供视频中前5个片段(峰)。
Adding the following snippet to parse/read through @Benjamin's API response.
This function will give you the top 5 snippets (peaks) from the video.