Davincible / goinsta

Unofficial Instagram API written in Golang (v2022)
MIT License
183 stars 56 forks source link

Uploading multiple Photos to one Post #36

Closed Freccia closed 2 years ago

Freccia commented 2 years ago

Would it be possible to upload several photos to one post ?

Something like that:

  // Upload Photo
  item, err := insta.Upload(
    &goinsta.UploadOptions{
      File1:     f1,
      File2:     f2,
      File3:     f2,
      File4:     f2,
      Caption:  "multiple photos post",
    },
  )
JB-BERRY commented 2 years ago

Up

Davincible commented 2 years ago

Yes, it's possible. See:

https://github.com/Davincible/goinsta/blob/4d9a0346219df37d8dcd6baea6f2e0b6416a4f4a/tests/upload_test.go#L259-L305

JB-BERRY commented 2 years ago

Could you share code for upload an album in a local folder ? Also it is possible to specify a filter on the album ?

thanks a lot for your work JB

Davincible commented 2 years ago

For local photos you just need to read in the file, you can find out how to do that by googling "go read file", you can then pass the bytes into a new buffer, and into the album.

Filters are not possible. On Instagram this does not happen on the server, but on the app. So the api only uploads picture with the filter already applied on it on your phone.

JB-BERRY commented 2 years ago

Sorry, I am very bad at golang.. It would really help if you could send me directly the code. Thanks in advance, JB

Davincible commented 2 years ago

https://gobyexample.com/reading-files