How to find mp4 video link from Instagram link

I work on a social network like facebook and you will need to extract mp4 from the Instagram link.

For photos, it was easy: url_shared = " http://instagram.com/p/a69ygTTHKq/ " photo_to_embed = url_shared + "? Size = t"

Do you know anything like this to find out a direct link to mp4? I tried to use my API and changed the extension from .jpg to ".mp4", but couldn’t work all the time.

For example: http://api.instagram.com/oembed?url=http://instagram.com/p/bCgbJ2pgCi/ returns { provider_url: "http://instagram.com/", media_id: "487094313204187298_9762431", title: "So did you download our "Hockey Community" app yet? If you like hockey even just a bit you should do it now!!'", url: "http://distilleryimage2.ak.instagram.com/d79af376deb011e2922a22000a1fdc29_7.jpg", author_name: "hockeycommunity", height: 612, width: 612, version: "1.0", author_url: "http://instagram.com/hockeycommunity", author_id: 9762431, type: "photo", provider_name: "Instagram" }

data.url = " http://distilleryimage2.ak.instagram.com/d79af376deb011e2922a22000a1fdc29_ 7.jpg ", and the video link is actually " http://distilleryimage2.ak.instagram.com/d79af376deb011e2922a22000a1fdc29_ 101.mp4 "

Only the end of the file name changes, but cannot determine which rule ...

A source:

+4
source share
2 answers

Instagram just released exactly what I was looking for: http://blog.instagram.com/post/55095847329/introducing-instagram-web-embeds

+1
source

Instagram video is just a new object in the JSON channel called "video". Actually there is a plugin already available for download that pulls in the video. You could probably just try the code here to see how this is done. Or just use the plugin, as it has already completed the task.

Instagram jquery video plugin

-5
source

Source: https://habr.com/ru/post/1488586/


All Articles