threads.js icon indicating copy to clipboard operation
threads.js copied to clipboard

Support client.posts.create add attachments

Open A-Marotta opened this issue 2 years ago • 5 comments

Hello

Would it be possible to get support in adding attachments to be included in the client.posts.create options?

A-Marotta avatar Jul 16 '23 09:07 A-Marotta

@elijah-wright

Looks like this is /rupload_igphoto/xxxxxxxxxxxxxxxxxxxx_0_yyyyyyyyyyy where X and Y are large numbers. I notice that the last number doesn't appear to change per client instance but the first one does. Maybe another repository has some better information.

From what I can tell you just post raw image data there. You get back:

{"upload_id":"zzzzzzzzzzzzzzzzzzzz","xsharing_nonces":{},"status":"ok"}

where Z is a large number.

Then you send it to /api/v1/media/configure_text_post_app_feed/ with the body as a SIGNATURE signed urlencoded json compatible with the type below:

interface Response {
  text_post_app_info: string;
  scene_capture_type: string;
  timezone_offset: string;
  source_type: string;
  _uid: string;
  device_id: string;
  _uuid: string;
  nav_chain: string;
  caption: string;
  audience: string;
  upload_id: string;
  device: {
    manufacturer: string;
    model: string;
    android_version: number;
    android_release: string;
  };
  extra: {
    source_width: number;
    source_height: number;
  }
}

Where the upload_id is the number you got back in the previous.

stevenlafl avatar Jul 16 '23 10:07 stevenlafl

awesome, I'll look into this today

elijah-wright avatar Jul 16 '23 16:07 elijah-wright

the first large number is the upload ID but idk how to get it

elijah-wright avatar Jul 17 '23 15:07 elijah-wright

I think you make it up. Which is weird. I could not find any requests on the app that remotely corresponded to it when profiling them

stevenlafl avatar Jul 19 '23 05:07 stevenlafl

it's the same thing with the post ID too

elijah-wright avatar Jul 22 '23 18:07 elijah-wright

already done in v2

elijah-wright avatar Jun 18 '24 15:06 elijah-wright