Class: PublishService

September 10, 2021 · View on GitHub

instagram-private-api / services / PublishService

Class: PublishService

services.PublishService

Hierarchy

  • Repository

    PublishService

Table of contents

Constructors

Methods

Constructors

constructor

new PublishService(client)

Parameters

NameType
clientIgApiClient

Inherited from

Repository.constructor

Defined in

src/core/repository.ts:7

Methods

album

album(options): Promise<any>

Parameters

NameType
optionsPostingAlbumOptions

Returns

Promise<any>

Defined in

src/services/publish.service.ts:211


igtvVideo

igtvVideo(options): Promise<any>

Parameters

NameType
optionsPostingIgtvOptions

Returns

Promise<any>

Defined in

src/services/publish.service.ts:400


photo

photo(options): Promise<MediaRepositoryConfigureResponseRootObject>

Uploads a single photo to the timeline-feed

Parameters

NameTypeDescription
optionsPostingPhotoOptionsthe options, containing caption and image-data

Returns

Promise<MediaRepositoryConfigureResponseRootObject>

Defined in

src/services/publish.service.ts:136


story

story(options): Promise<any>

Parameters

NameType
optionsPostingStoryPhotoOptions | PostingStoryVideoOptions

Returns

Promise<any>

Defined in

src/services/publish.service.ts:284


video

video(options): Promise<MediaRepositoryConfigureResponseRootObject>

Parameters

NameType
optionsPostingVideoOptions

Returns

Promise<MediaRepositoryConfigureResponseRootObject>

Defined in

src/services/publish.service.ts:154


catchTranscodeError

Static catchTranscodeError(videoInfo, transcodeDelayInMs): (error: any) => Bluebird<void>

The current way of handling the 202 - Accepted; Transcode pending -error

Parameters

NameTypeDescription
videoInfoanyThe video info for debugging reasons
transcodeDelayInMsnumberThe delay for instagram to transcode the video

Returns

fn

▸ (error): Bluebird<void>

Parameters
NameType
errorany
Returns

Bluebird<void>

Defined in

src/services/publish.service.ts:42


getMP4Duration

Static getMP4Duration(buffer): number

Reads the duration in ms from any MP4 file with at least one stream (a/v)

Parameters

NameType
bufferBuffer

Returns

number

Defined in

src/services/publish.service.ts:74


getVideoInfo

Static getVideoInfo(buffer): Object

Gets duration in ms, width and height info for a video in the mp4 container

Parameters

NameTypeDescription
bufferBufferBuffer, containing the video-file

Returns

Object

duration in ms, width and height in px

NameType
durationnumber
heightnumber
widthnumber

Defined in

src/services/publish.service.ts:60