检索API Instagram的视频嵌入网址 [英] Retrieve Instagram video embed URL from API

查看:158
本文介绍了检索API Instagram的视频嵌入网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到以编程方式获取嵌入链接的Instagram的视频。不幸的是,它似乎的Instagram的透过oEmbed端点,把视频照片,并只返回关键帧图像,而不是提供一个嵌入的链接。

I'm trying to find to programmatically get the embed link for an Instagram video. Unfortunately, it appears that Instagram's oEmbed endpoint, treats videos as photos, and only returns the key frame image, rather than providing an embed link.

有谁知道一个方法来检索嵌入链接的Instagram的视频,而无需手动访问的页面为视频?

Does anyone know of a way to retrieve the embed link for an instagram video without having to manually visit the page for that video?

推荐答案

根据的Instagram的API网站一个<强> GET /媒体/媒体-ID 请求视频对象返回与您在data.videos.low_resolution.url所需信息的JSON对象。

According to Instagram's API site a GET /media/media-id request for a video object returns a JSON object with the information you need in "data.videos.low_resolution.url".

我成功地嵌入其样品的要求有以下code返回到网页视频:

I successfully embedded the video returned by their sample request into a web page with the following code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Video Embed Test</title>
  </head>
  <body>
    <video width="480" height="480" controls>
    <source src="http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4" 
      type="video/mp4"/>
    </video>
  </body>
</html>

这篇关于检索API Instagram的视频嵌入网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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