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

查看:163
本文介绍了如何通过视频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/using

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交互的逻辑,以使用通过查询参数(从https://example.com/blogger/video-play.mp4?contentId=VideoID获取)的 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 Feed中的content.$t属性中,可以为特定视频提取 Video Token .

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

使用视频令牌,将GET请求发送至-

Using the Video Token, send a GET request to -

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

可以通过解析响应来提取实际的视频URL.响应将以HTML格式显示,实际的URL用键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天全站免登陆