Git Product home page Git Product logo

Comments (2)

ishandutta2007 avatar ishandutta2007 commented on July 4, 2024

The way of sending media[video][details][location] using Content-Type": "application/x-www-form-urlencoded actually works. My bad that I said it doesn't . I have tested it with an old video(ie whose id I already knew from the web version), it works.
But for new videos there is still some work to be done. It doesn't work if the video is not in their s3 bucket. So I have to figure out how to make a request to first put the video in their s3 bucket(rather than mine) and then get the generated video id just like how they do via web. I will keep posting my findings. Views welcome

from buffpy.

ishandutta2007 avatar ishandutta2007 commented on July 4, 2024

It's actually 3 step process:

  • GET on https://publish.buffer.com/rpc to get etag
  • POST on https://buffer-media-uploads.s3.amazonaws.comto upload the video to s3 {s3_bucket_id}/{etag} with
key: {s3_bucket_id}/uploads/{1567502606048}-my-original-finename.mp4
Content-Type: video/mp4
  • POST on /1/updates/{post_id}/update.json
    (here we use the etag as id and also construct video[detail][location] with it)
    with media json like this:
 {
       "progress":100,
        "uploaded":True,
        "uploading_type":"video",
        "video":{
            "title": "some titile",
            "id": etag,
            "details":{
                  "location": "https://buffer-media-uploads.s3.amazonaws.com/{s3_bucket_id}/{etag}/doesntmatter.mp4",
                  "transcoded_location": "https://buffer-media-uploads.s3.amazonaws.com/{s3_bucket_id}/{etag}/doesntmatter.mp4",
                  "file_size":6767009,
                   "duration":27,
                   "duration_millis":26611,
                   "width":480,
                   "height":270
             },
             "thumbnails":[
                   photo_link,
                   photo_link2
             ]
          }
}

from buffpy.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.