简体   繁体   English

如何从 Instagram 公共访问 API 获取视频?

[英]How to get video from Instagram public access API?

I know that this api is working to get images but how about videos?我知道这个 api 正在努力获取图像,但是视频呢?
https://www.instagram.com/username/?__a=1

I was able to get the thumbnail of the video but not the source or the url itself.我能够获得视频的缩略图,但无法获得来源或网址本身。

When you make above API call it would return code in it.当您进行上述 API 调用时,它会返回其中的code looks something like this: BWhyIhRDBCw看起来像这样: BWhyIhRDBCw

Whenever your media nodes has "is_video": true you can make following call:每当您的媒体节点具有"is_video": true您可以进行以下调用:

https://www.instagram.com/p/{code}/?__a=1

for eg, https://www.instagram.com/p/BWhyIhRDBCw/?__a=1例如, https://www.instagram.com/p/BWhyIhRDBCw/?__a=1

This would return another json.这将返回另一个 json。 which will have video_url you are looking for.这将有您正在寻找的video_url

sample:样本:

"video_url": "https://scontent-bom1-1.cdninstagram.com/vp/437699b67172f450331fa732f0777b18/5A7FE0A0/t50.2886-16/20138822_486349355081174_1539674401849475072_n.mp4",

This url working in local machine but not on my remote server.这个 url 在本地机器上工作,但不在我的远程服务器上。

When i try to hit from remote server its returning html content.当我尝试从远程服务器点击它返回的 html 内容时。

要访问此 api,只需使用 volly 库,它将返回 json,然后您可以根据需要解析 json。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM