Facebook Graph - Get a high quality video from API

Viewed 306

I am using this API call to get the Page's Post details and this one includes the Post's Video Source.

https://graph.facebook.com/v5.0/{page id}/posts?fields=from{id,name,picture},status_type,attachments,full_picture,picture,message,story,properties,created_time,shares,comments.limit(0).summary(true).as(comments),likes.limit(0).summary(true).as(likes),permalink_url

This API call responds with these data:

{
      "from": {
        "id": "123123",
        "name": "abcd",
        "picture": {
          "data": {
            "height": 50,
            "is_silhouette": false,
            "url": "https://scontent.fmnl4-6.fna.fbcdn.net/v/t1.0-1/cp0/p50x50/123123_123123",
            "width": 50
          }
        }
      },
      "status_type": "added_video",
      "attachments": {
        "data": [
          {
            "media": {
              "image": {
                "height": 405,
                "src": "https://fb.com/adsfasdf",
                "width": 720
              },
              "source": "https://video-fb-source.com.fb.mp4?_nc_cat=1231&cb=3"
            },
            "target": {
              "id": "240206797735633",
              "url": "https://www.facebook.com/asd1asdfasdf"
            },
            "title": "test 123123",
            "type": "video_autoplay",
            "url": "https://www.facebook.com/hahahae/videos/240206797735633/"
          }
        ]
      },
      "full_picture": "https://scontent.fmnl4-6.fna.fbcdn.net/v/t15.5256-10/145288627_240218977734415_42016794327.jpg?",
      "picture": "https://scontent.fmnl4-6.fna.fbcdn.net/v/t15.5256-10/145288627_240218977734415_42016794327.jpg?",
      "message": "haha hahahaha",
      "properties": [
        {
          "name": "Length",
          "text": "41:20"
        }
      ],
      "created_time": "2021-02-15T18:00:01+0000",
      "shares": {
        "count": 7
      },
      "comments": {
        "data": [
        ],
        "summary": {
          "order": "ranked",
          "total_count": 1,
          "can_comment": true
        }
      },
      "likes": {
        "data": [
        ],
        "summary": {
          "total_count": 16,
          "can_like": true,
          "has_liked": false
        }
      },
      "permalink_url": "https://www.facebook.com/xxxx/posts/xxx/",
      "id": "xxxx_123123_xxx"
    },

I get the Post's Video Source from the attachments.data[0].media.source json, then every time I get the video, I download it on my local.

My problem with that is it does not return a high-quality video, it's a bit pixelated. Unlike in Facebook, when you go directly to the video URL, there's a 1080p option.

How can I get a high-quality video that I can download through Facebook's Graph API?

Thanks.

0 Answers
Related