如何通过视频ID获取博主视频的链接? [英] How to get the link from blogger video by the video ID?

查看:53
本文介绍了如何通过视频ID获取博主视频的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现一些网站使用自己的域来使用来自博主的嵌入视频,例如:https://example.com/blogger/video-play.mp4?contentId=264f2ge544g86h49.

I have found some sites that use their own domain to use embed videos from blogger, example: https://example.com/blogger/video-play.mp4?contentId=264f2ge544g86h49.

PS:https://example.com 不是博主托管的域,它是博主之外的域

PS: https://example.com is not a domain hosted on blogger, it's outside blogger

264f2ge544g86h49 是上传到博主的视频ID.

264f2ge544g86h49 is the ID of a video uploaded to blogger.

它是如何制作的?有教程吗我在 https://developers.google.com/blogger/上没有找到任何相关信息docs/3.0/使用

How is it made? There's a tutorial? I did not find anything about it on https://developers.google.com/blogger/docs/3.0/using

推荐答案

总结我们在上述评论中得出的解决方案.这将需要以您选择的语言编写服务器端逻辑,以使用视频 ID 或视频令牌提取实际视频链接.

To summarize the solution that we reached in the comments above. This will require writing server-side logic in the language of your choice to extract the actual video link using the Video ID or Video Token.

更复杂的方法是直接使用视频 ID (https://example.com/blogger/video-play.mp4?contentId=VideoID).您需要编写与 Blogger API 交互的逻辑,以使用通过查询参数获得的 VideoID 编辑/创建帖子(从 https://example.com/blogger/获得)video-play.mp4?contentId=VideoID).博文会有以下内容-

The more complicated approach would be using the Video ID directly ( https://example.com/blogger/video-play.mp4?contentId=VideoID). You will need to write logic for interacting with Blogger API to edit/create a post using the VideoID that you get via the query parameter (obtained from https://example.com/blogger/video-play.mp4?contentId=VideoID). The blog post will have the following content -

<object id="BLOG_video-VideoID" class="BLOG_video_class" contentid="VideoID"></object>

现在可以通过

https://www.blogger.com/feeds/BLOGID/posts/default/POSTID?alt=json

从上述 JSON 提要中的 content.$t 属性,可以提取特定视频的 视频令牌.

From the content.$tproperty in the above JSON feed, it would be possible to extract the Video Token for the particular video.

使用视频令牌,向 -

https://www.blogger.com/video.g?token=VideoToken

可以通过解析响应来提取实际的视频 URL.响应将在 HTML 中,实际 URL 存在于 JavaScript 对象中,键为 play_url -

It would be possible to extract the actual video URL by parsing the response. The response will be in HTML, the actual URL is present in the JavaScript object with the key play_url -

var VIDEO_CONFIG = {
    "thumbnail": "Thumbnail-URL",
    "iframe_id": "BLOGGER-video-VideoID-6712",
    "allow_resize": false,
    "streams": [{
        "play_url": "Actual-Video-URL",
        "format_id": 18
    }, {
        "play_url": "Actual-Video-URL-Higher-Resolution",
        "format_id": 22
    }]
};

<小时>

一种更简单的方法是直接从视频令牌开始,因为这样就不需要与 Blogger API & 交互.完全喂.


A simpler approach would be starting directly with the Video Token as that would do away with the need for interacting with the Blogger API & Feeds completely.

以前,可以仅使用视频 ID 获取实际视频链接(使用类似 https://www.blogger.com/video-play.mp4?contentId=VIDEOID 的格式)).这意味着在将视频上传到 Blogger 后,不需要发布帖子.但从 2018 年 11 月左右开始,Blogger 转向基于令牌的视频 URL(如 https://www.blogger.com/video.g?token=TOKEN).只有在发布包含视频的帖子后才能知道该令牌.发生这种变化的原因可能是 Blogger 大约在同一时间推出了视频管理选项

Previously, it was possible to get the actual video link using only the Video ID (Using a format like https://www.blogger.com/video-play.mp4?contentId=VIDEOID). This meant that after uploading the video to Blogger, it wasn't required to publish a post. But starting around November 2018, Blogger shifted to a token-based video URL (like https://www.blogger.com/video.g?token=TOKEN). That token can only be known after the post containing the video is published. This change likely happened due to the Video Management option that Blogger introduced around the same time

这篇关于如何通过视频ID获取博主视频的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆