Instagram-private-api: Upload photo

Created on 17 Jun 2016  路  2Comments  路  Source: dilame/instagram-private-api

is posible upload photo? i try this:

var promise = Client.Session.create(device, cookiePath, 'username', 'pass')

promise.then(function(sessionInstance) {
  Client.Upload.photo(sessionInstance, 'test.jpg').then(function (out) {
    console.log(out)
  })
})

return Upload object, but no upload 馃槩

question

Most helpful comment

@jlobos of course its possible :P here is how to do it:

// import Client as Client.V1

var pathOrStream = './path/to/img.jpg';
Client.Session.create(device, cookiePath, 'username', 'pass')
.then(function(session){
  return [Client.Upload.photo(session, pathOrStream), session]
})
.spread(function(upload, session) {
  return Client.Media.configurePhoto(session, upload.params.uploadId, "you can provide caption or go let it go")
})
.then(function(medium) {
  console.log(medium) // -> return Instance of Client.Media
})

should work that way, try it out...

All 2 comments

@jlobos of course its possible :P here is how to do it:

// import Client as Client.V1

var pathOrStream = './path/to/img.jpg';
Client.Session.create(device, cookiePath, 'username', 'pass')
.then(function(session){
  return [Client.Upload.photo(session, pathOrStream), session]
})
.spread(function(upload, session) {
  return Client.Media.configurePhoto(session, upload.params.uploadId, "you can provide caption or go let it go")
})
.then(function(medium) {
  console.log(medium) // -> return Instance of Client.Media
})

should work that way, try it out...

@huttarichard awesome, very thank!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ciolt picture ciolt  路  35Comments

iMrDJAi picture iMrDJAi  路  34Comments

delmotte picture delmotte  路  61Comments

LouenLeoncoeur picture LouenLeoncoeur  路  12Comments

nikitaulshin picture nikitaulshin  路  17Comments