Hi I tried the video upload from the README, but I'm getting an "Unhandled rejection ParseError: Not possible to parse API response" error. I had the same issue and it was b/c instagram won't allow metadata. Any suggestions or experience with this error?
Thanks
Hi is it even possible to upload videos and photos to Instagram?
because I think they don't allow this
Photo upload worked for me. I'm getting a promise rejection error from video. I literally copied their example code.
Client.Session.create(device, storage, 'XXXXXX', 'XXXXXX')
.then(function(session) {
//console.log(session)
console.log(__dirname + '\\test_image\\out1.mp4')
// MP4 is the only supported format now, pull request for any other format welcomed!
Client.Upload.video(session, __dirname + '\\test_image\\out1.mp4', __dirname + '\\test_image\\out_im.jpg')
.then(function(upload) {
console.log('asdf')
return Media.configureVideo(session, upload.uploadId, 'aaa', 4000.0);
})
/*
.catch(function(error) {
console.log(error)
})
*/
.then(function(medium) {
// we configure medium, it is now visible with caption
console.log(medium.params)
})
/*
.catch(function(error) {
console.log(error)
})
*/
})
The problem is on the first step https://i.instagram.com/api/v1/upload/video/.
I call @IvanMMM :)
It seems like instagram changed API, because problem even not in video file.
The spell worked :)
Yeah, I got the same api error. I'l check it.
Found the problem. Now Insta requires fields "upload_media_width" && "upload_media_height". Any ideas how can we get it without heavy tools like ffmpeg and others?
We get the duration right from the buffer with this code:
var pos = buffer.indexOf(new Buffer('mvhd')) + 17;
var timeScale = buffer.readUInt32BE(pos, 4); pos += 4;
var duration = buffer.readUInt32BE(pos, 4); pos += 4;
Ideally, we need exact same code to get video w|h. Question is about buffer offsets.
Used 720x720 values. Not sure if insta even checks values we pass to it :)
Fixed in #189.
Most helpful comment
Photo upload worked for me. I'm getting a promise rejection error from video. I literally copied their example code.
Client.Session.create(device, storage, 'XXXXXX', 'XXXXXX')
.then(function(session) {
//console.log(session)