igdl

package
v0.0.0-...-9da679e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Unlicense Imports: 16 Imported by: 6

README

===========================================================================================
Download Instagram Photo, Video, Story, Highlight, Postlive, Following, and Follower in Go_
===========================================================================================

.. image:: https://img.shields.io/badge/Language-Go-blue.svg
   :target: https://golang.org/

.. image:: https://godoc.org/github.com/siongui/instago/download?status.png
   :target: https://godoc.org/github.com/siongui/instago/download

.. image:: https://api.travis-ci.org/siongui/instago.png?branch=master
   :target: https://travis-ci.org/siongui/instago

.. image:: https://goreportcard.com/badge/github.com/siongui/instago/download
   :target: https://goreportcard.com/report/github.com/siongui/instago/download

.. image:: https://img.shields.io/badge/license-Unlicense-blue.svg
   :target: https://raw.githubusercontent.com/siongui/instago/master/UNLICENSE

.. image:: https://img.shields.io/badge/Status-Beta-brightgreen.svg

.. image:: https://img.shields.io/twitter/url/https/github.com/siongui/instago.svg?style=social
   :target: https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D


Download Instagram_ media (photos and videos), stories, story highlights,
postlives (live stream that shared to stories after end) in Go.


Obtain Cookies
++++++++++++++

Use `Chrome extension in this repo <crx-cookies>`_ to get the cookies. Save it
as *auth.json*. We will use it later to access Instagram API.


Terminology
+++++++++++

Given the URL of the post as follows:

::

  https://www.instagram.com/p/BfJzG64BZVY/

The *code* of the post is **BfJzG64BZVY**.


Usage
+++++

You have to install wget_ and ffmpeg_ first. Because of this reason, this
package works only on Linux systems currently. For Ubuntu users, wget comes with
the distribution by default, and you can install ffmpeg_ as follow:

.. code-block:: bash

  $ sudo apt-get install ffmpeg

Then you can install this package:

.. code-block:: bash

  $ go get -u github.com/siongui/instago/download

The name of this package is *igdl*.

The following are examples that you may be interested in:

- `timeline.go <example/timeline.go>`_: download posts in your timeline.
- `storypostlive.go <example/storypostlive.go>`_: download stories and postlives
  of your following users.
- `highlights.go <example/highlights.go>`_: download story highlights of all
  following users.
- `allposts.go <example/allposts.go>`_: download all posts of a single user.
- `allpostsnologin.go <example/allpostsnologin.go>`_: download all posts of a
  single user without login
- `userstory.go <example/userstory.go>`_: given username, download unexpired
  stories of the user.
- `userstoryhighlight.go <example/userstoryhighlight.go>`_: given username,
  download story highlights of the user.
- `saved.go <example/saved.go>`_: download all your saved posts.

See godoc_ for complete list of download methods.


UNLICENSE
+++++++++

Released in public domain. See UNLICENSE_.


.. _Go: https://golang.org/
.. _Instagram: https://www.instagram.com/
.. _Chrome Developer Tools: https://developer.chrome.com/devtools
.. _SO answer: https://stackoverflow.com/a/44773079
.. _Obtain cookies: https://github.com/hoschiCZ/instastories-backup#obtain-cookies
.. _instastories-backup: https://github.com/hoschiCZ/instastories-backup
.. _EditThisCookie: https://www.google.com/search?q=EditThisCookie
.. _cookie-txt-export: https://github.com/siongui/cookie-txt-export.go
.. _UNLICENSE: http://unlicense.org/
.. _wget: https://www.gnu.org/software/wget/
.. _ffmpeg: https://www.ffmpeg.org/
.. _godoc: https://godoc.org/github.com/siongui/instago/download

Documentation

Overview

Package igdl helps you download posts, stories and story highlights of Instagram users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIdUsernameMapFromLocalData

func BuildIdUsernameMapFromLocalData(idusernamedir string) (m map[string][]string, err error)

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string) (err error)

Create directory if it does not exist

func CreateFilepathDirIfNotExist

func CreateFilepathDirIfNotExist(filepath string)

func CyanPrint

func CyanPrint(a ...interface{})

func CyanPrintln

func CyanPrintln(a ...interface{})

func DiffFollowData

func DiffFollowData(dir, keyword string) (err error)

Given directory which contains data saved by running at leat twice SaveSelfFollow(), find out who blocks, disappears, kicks off. Or newly added.

func DiffFollowUsers

func DiffFollowUsers(users0, users1 []instago.IGFollowUser)

Set Difference: users1 - users0

func DownloadAllPostsNoLogin

func DownloadAllPostsNoLogin(username string) (err error)

Given username, download all posts of the user without login.

func DownloadIGMedia

func DownloadIGMedia(em instago.IGMedia) (isDownloaded bool, err error)

DownloadIGMedia downloads photos/videos in the post. IGItem (items in timeline or saved posts) or IGMedia (read from https://www.instagram.com/p/{{CODE}}/?__a=1) can be argument in this method.

func DownloadPostLive

func DownloadPostLive(pl instago.IGPostLive, isDownloading map[string]bool)

func DownloadPostLiveItem

func DownloadPostLiveItem(pli instago.IGPostLiveItem) (err error)

func DownloadPostNoLogin

func DownloadPostNoLogin(code string) (isDownloaded bool, err error)

func DownloadRecentPostsNoLogin

func DownloadRecentPostsNoLogin(username string)

Given user name, download recent posts (usually 12 posts) of the user without login status.

func DownloadUserProfilePicUrlHd

func DownloadUserProfilePicUrlHd(username string)

DownloadUserProfilePicUrlHd downloads user profile pic of the given user name. (usually 320x320)

func ExcludeCommentAndWhitespace

func ExcludeCommentAndWhitespace(lines []string) (elines []string)

Given slice of strings, exclude string that starts with //, and also exclude strings contains only whitespace.

func FileToLines

func FileToLines(filePath string) (lines []string, err error)

func FindIdFromUsernameInMap

func FindIdFromUsernameInMap(m map[string][]string, username string) (id string)

func GetFollowDir

func GetFollowDir() string

func GetIdUsernameDir

func GetIdUsernameDir() string

func GetIdUsernamePath

func GetIdUsernamePath(id, username string) string

func GetLatestFile

func GetLatestFile(dir, keyword string) (latest os.FileInfo, err error)

func GetPostFilePath

func GetPostFilePath(username, id, code, url string, timestamp int64, taggedusers []instago.IGTaggedUser) string

func GetReelMediaUnixTimesInUserStoryDir

func GetReelMediaUnixTimesInUserStoryDir(username string) (utimes []string, err error)

func GetReelMentionsPath

func GetReelMentionsPath(id, username string) string

func GetScreenshotPath

func GetScreenshotPath(id, username string) string

func GetStoryFilePath

func GetStoryFilePath(username, id, code, url string, timestamp int64, rms []instago.ItemReelMention) string

func GetStoryItem

func GetStoryItem(item instago.IGItem, username string) (isDownloaded bool, err error)

GetStoryItem downloads the given story item. If the story item already exists on local machine, story download will be ignored and isDownloaded is set to false.

func GetTimeFromStoryFilename

func GetTimeFromStoryFilename(filename string) (t time.Time, err error)

func GetUserDataDirChromiumSnap

func GetUserDataDirChromiumSnap(username string) (userdatadir string, err error)

Given user name, get the location of user data dir of Chromium of Ubuntu snap version.

func GetUserDir

func GetUserDir(username string) (dir string)

func GetUserStoryDir

func GetUserStoryDir(username string) (dir string)

func IsCommandAvailable

func IsCommandAvailable(name string) bool

func IsLatestReelMediaExist

func IsLatestReelMediaExist(username string, latestReelMedia int64) bool

func IsOlderThanOneDay

func IsOlderThanOneDay(t time.Time) bool

func IsTrayInfoInQueue

func IsTrayInfoInQueue(queue []TrayInfo, ti TrayInfo) bool

func LoadFollowUsers

func LoadFollowUsers(filepath string) (users []instago.IGFollowUser, err error)

Load []instago.IGFollowUser from JSON file, which is created by SaveSelfFollowers or SaveSelfFollowing methods.

func LoadLatestFollowingUsers

func LoadLatestFollowingUsers() (users []instago.IGFollowUser, err error)

func MoveExpiredStory

func MoveExpiredStory(storydir, todir string) (err error)

MoveExpiredStory moves all expired stories to another directory. Here "expired" means older than one day. Stories means file containing "-story-" in the filename.

func MoveFileToDir

func MoveFileToDir(todir, path string, info os.FileInfo) error

func MovePost

func MovePost(fromdir, todir string) (err error)

MovePost moves all files containing "-post-" in the filename to another directory.

func PrintBestiesItemInfo

func PrintBestiesItemInfo(item instago.IGItem, username string)

func PrintDownloadStoryLayerInfo

func PrintDownloadStoryLayerInfo(item instago.IGItem, username string)

func PrintItemInfo

func PrintItemInfo(index int, pi instago.PostItem)

func PrintLiveBroadcasts

func PrintLiveBroadcasts(bcs []instago.IGBroadcast)

func PrintMsgSleep

func PrintMsgSleep(sleepInterval int, msg string)

func PrintPostLiveItem

func PrintPostLiveItem(pli instago.IGPostLiveItem)

func PrintReelMentionInfo

func PrintReelMentionInfo(rm instago.ItemReelMention)

func PrintTrayInfo

func PrintTrayInfo(ti TrayInfo)

func PrintTrayInfoMsg

func PrintTrayInfoMsg(ti TrayInfo, msg ...interface{})

func PrintUserComment

func PrintUserComment(user instago.User)

func PrintUserInfo

func PrintUserInfo(user instago.User)

func PrintUsernameIdMsg

func PrintUsernameIdMsg(username, id interface{}, msg ...interface{})

func ProcessTray

func ProcessTray(c chan TrayInfo, tray instago.IGReelTray, layer int64, ignoreMuted, verbose bool)

func ProcessTrayItem

func ProcessTrayItem(c chan TrayInfo, item instago.IGItem, ti TrayInfo, ignoreReelMentionsIfStoryItemExist, ignorePrivateReelMention, verbose bool) (err error)

func ReadNonCommentLines

func ReadNonCommentLines(filePath string) (lines []string, err error)

read non-empty lines that does not start with //

func RedPrint

func RedPrint(a ...interface{})

func RedPrintln

func RedPrintln(a ...interface{})

func SetDataDir

func SetDataDir(s string)

func SetOutputDir

func SetOutputDir(s string)

func SetSaveData

func SetSaveData(b bool)

Default is false (not save data).

func SleepLog

func SleepLog(interval int)

func SleepSecond

func SleepSecond(interval int)

func UsernameIdColorPrint

func UsernameIdColorPrint(username, id interface{})

func Wget

func Wget(url, filepath string) error

Call shell command wget to download. The reason to use wget is that wget supports automatically resume download. So this package only runs on Linux systems.

Types

type IGDownloadManager

type IGDownloadManager struct {
	// contains filtered or unexported fields
}

func NewInstagramDownloadManager

func NewInstagramDownloadManager(authFilePath string) (*IGDownloadManager, error)

The arguments here is the same as the NewInstagramApiManager of instago. See README of instago for more informantion

func (*IGDownloadManager) AccessReelsTrayOnce

func (m *IGDownloadManager) AccessReelsTrayOnce(c chan TrayInfo, ignoreMuted, verbose bool) (err error)

func (*IGDownloadManager) AccessReelsTrayOnce2Chan

func (m *IGDownloadManager) AccessReelsTrayOnce2Chan(cPublicUser, cPrivateUser chan TrayInfo, ignoreMuted, verbose bool) (err error)

func (*IGDownloadManager) CheckZero

func (m *IGDownloadManager) CheckZero(dir1, dir2 string) (err error)

For some reasons, wget will leave files with 0 size because of download failure. This function try to find zero files and re-download them. dir1 is the directory which contains downloaded files, and the zero files will be moved to dir2.

func (*IGDownloadManager) CollectionId2Name

func (m *IGDownloadManager) CollectionId2Name(id string) string

func (*IGDownloadManager) CollectionName2Id

func (m *IGDownloadManager) CollectionName2Id(name string) string

func (*IGDownloadManager) DownloadAllPosts

func (m *IGDownloadManager) DownloadAllPosts(username string) (err error)

Given username, download all posts of the user with logged in status.

func (*IGDownloadManager) DownloadAllPostsNoLogin

func (m *IGDownloadManager) DownloadAllPostsNoLogin(username string) (err error)

Given username, download all posts of the user without login.

func (*IGDownloadManager) DownloadAllPostsNoLoginIfPossible

func (m *IGDownloadManager) DownloadAllPostsNoLoginIfPossible(username string) (err error)

FIXME: only works for public account now

func (*IGDownloadManager) DownloadDependOnCollectionName

func (m *IGDownloadManager) DownloadDependOnCollectionName(name2layer, nameAllpost, nameHighlight string, c chan instago.IGItem)

DO NOT USE. Test now. Used with DownloadSavedPostsAndSendItemInCollectionToChannel

func (*IGDownloadManager) DownloadPost

func (m *IGDownloadManager) DownloadPost(code string) (isDownloaded bool, err error)

func (*IGDownloadManager) DownloadPostNoLoginIfPossible

func (m *IGDownloadManager) DownloadPostNoLoginIfPossible(code string) (isDownloaded bool, err error)

func (*IGDownloadManager) DownloadSavedCollectionPosts

func (m *IGDownloadManager) DownloadSavedCollectionPosts(collectionName string) (err error)

DownloadSavedCollectionPosts downloads saved posts in given collection name. Remember to call (m *IGDownloadManager) LoadCollectionList() before calling this method.

func (*IGDownloadManager) DownloadSavedCollectionPostsAndSendItemInCollectionToChannel

func (m *IGDownloadManager) DownloadSavedCollectionPostsAndSendItemInCollectionToChannel(collectionName string, downloadStory bool, c chan instago.IGItem) (err error)

DO NOT USE. Test now. Used with DownloadDependOnCollectionName

func (*IGDownloadManager) DownloadSavedPosts

func (m *IGDownloadManager) DownloadSavedPosts(numOfItem int, downloadStory bool)

DownloadSavedPost downloads your saved posts. -1 means download all saved posts. downloadStory flag will also download unexpired stories of the post user.

func (*IGDownloadManager) DownloadSavedPostsAndSendItemInCollectionToChannel

func (m *IGDownloadManager) DownloadSavedPostsAndSendItemInCollectionToChannel(numOfItem int, downloadStory bool, c chan instago.IGItem) (err error)

DO NOT USE. Test now. Used with DownloadDependOnCollectionName

func (*IGDownloadManager) DownloadStoryForever

func (m *IGDownloadManager) DownloadStoryForever(interval1 int, interval2 int64, ignoreMuted, verbose bool)

DownloadStoryForever downloads reels tray periodically. interval1 is the interval for access to reels tray API. interval2 is the interval for fetching user stories. ignoreMute will ignore stories of muted users if true. verbose will print more info if true. If not sure, try (90, 60, true, true). If http 429 happens, try to use longer interval.

func (*IGDownloadManager) DownloadStoryForeverPublicReelMentions

func (m *IGDownloadManager) DownloadStoryForeverPublicReelMentions(interval1 int, interval2 int64, ignoreMuted, verbose bool)

func (*IGDownloadManager) DownloadStoryFromUserIdFile

func (m *IGDownloadManager) DownloadStoryFromUserIdFile(useridfile string, interval int64, verbose bool) (err error)

func (*IGDownloadManager) DownloadStoryHighlights

func (m *IGDownloadManager) DownloadStoryHighlights()

Download story highlights of all following users

func (*IGDownloadManager) DownloadStoryOfMultipleId

func (m *IGDownloadManager) DownloadStoryOfMultipleId(multipleIds []string) (err error)

DownloadStoryOfMultipleId downloads stories of multiple user id via reels media API. If a newly created account use this method to download stories, it may cause Instagram to block your account. Be careful before use. Also note that the max length of multipleIds allowed in the API call is between 20 to 30.

func (*IGDownloadManager) DownloadTimeline

func (m *IGDownloadManager) DownloadTimeline(n int)

download timeline until page n

func (*IGDownloadManager) DownloadTrayInfos

func (m *IGDownloadManager) DownloadTrayInfos(tis []TrayInfo, c chan TrayInfo, tl *TimeLimiter, ignoreReelMentionsIfStoryItemExist, ignorePrivateReelMention, verbose bool)

func (*IGDownloadManager) DownloadUnexpiredStoryOfAllFollowingUsers

func (m *IGDownloadManager) DownloadUnexpiredStoryOfAllFollowingUsers(interval int) (err error)

DO NOT USE. Due to Instagram changes the rate limit of private API, use of this method will cause HTTP 429. Will be removed soon.

func (*IGDownloadManager) DownloadUnexpiredStoryOfFollowUsers

func (m *IGDownloadManager) DownloadUnexpiredStoryOfFollowUsers(users []instago.IGFollowUser, interval int) (err error)

DO NOT USE. Due to Instagram changes the rate limit of private API, use of this method will cause HTTP 429. Will be removed soon.

func (*IGDownloadManager) DownloadUnexpiredStoryOfUser

func (m *IGDownloadManager) DownloadUnexpiredStoryOfUser(user instago.User) (err error)

DO NOT USE. Due to Instagram changes the rate limit of private API, use of this method will cause HTTP 429. Will be removed soon.

func (*IGDownloadManager) DownloadUserReelMedia

func (m *IGDownloadManager) DownloadUserReelMedia(id string) (err error)

DownloadUserReelMedia downloads unexpired stories (last 24 hours) of the given user id. No postlives included.

func (*IGDownloadManager) DownloadUserReelMediaByName

func (m *IGDownloadManager) DownloadUserReelMediaByName(username string) (err error)

DownloadUserReelMediaByName downloads unexpired stories (last 24 hours) of the given user name. No postlives included.

func (*IGDownloadManager) DownloadUserReelMediaLayer

func (m *IGDownloadManager) DownloadUserReelMediaLayer(id string, layer, interval int64) (err error)

DownloadUserReelMediaLayer downloads reel mentions in the stories as well. Parameter layer 1 is actually the same as DownloadUserReelMedia.

func (*IGDownloadManager) DownloadUserStory

func (m *IGDownloadManager) DownloadUserStory(id string) (err error)

func (*IGDownloadManager) DownloadUserStoryByName

func (m *IGDownloadManager) DownloadUserStoryByName(username string) (err error)

func (*IGDownloadManager) DownloadUserStoryByNameLayer

func (m *IGDownloadManager) DownloadUserStoryByNameLayer(username string, layer, interval int64) (err error)

func (*IGDownloadManager) DownloadUserStoryHighlights

func (m *IGDownloadManager) DownloadUserStoryHighlights(userid string)

Download story highlights of a single user.

func (*IGDownloadManager) DownloadUserStoryHighlightsByName

func (m *IGDownloadManager) DownloadUserStoryHighlightsByName(username string)

Given username, download story highlights of the user.

func (*IGDownloadManager) DownloadUserStoryLayer

func (m *IGDownloadManager) DownloadUserStoryLayer(id string, layer, interval int64) (err error)

func (*IGDownloadManager) FindNewUsernameFromOldName

func (m *IGDownloadManager) FindNewUsernameFromOldName(idUsernameMap map[string][]string, oldname string) (username string)

func (*IGDownloadManager) GetAllPostMedia

func (m *IGDownloadManager) GetAllPostMedia(username string) ([]instago.IGMedia, error)

func (*IGDownloadManager) GetAllPostMediaNoLoginIfPossible

func (m *IGDownloadManager) GetAllPostMediaNoLoginIfPossible(username string) (medias []instago.IGMedia, err error)

func (*IGDownloadManager) GetCleanAccountManager

func (m *IGDownloadManager) GetCleanAccountManager() *IGDownloadManager

func (*IGDownloadManager) GetMultipleReelsMedia

func (m *IGDownloadManager) GetMultipleReelsMedia(userids []string) ([]instago.IGReelsMediaTray, error)

func (*IGDownloadManager) GetPostInfo

func (m *IGDownloadManager) GetPostInfo(code string) (instago.IGMedia, error)

func (*IGDownloadManager) GetPostItem

func (m *IGDownloadManager) GetPostItem(item instago.IGItem, isSmartDownload bool) (isDownloaded bool, err error)

GetPostItem downloads media (photo/video) item in the post. If you want best quality download, set isSmartDownload = true. If you get HTTP 429 or cannot access API, set isSmartDownload = false

func (*IGDownloadManager) GetReelsTray

func (m *IGDownloadManager) GetReelsTray() (instago.IGReelsTray, error)

func (*IGDownloadManager) GetSavedPosts

func (m *IGDownloadManager) GetSavedPosts(numOfItem int) ([]instago.IGItem, error)

func (*IGDownloadManager) GetSelfFollowers

func (m *IGDownloadManager) GetSelfFollowers() ([]instago.IGFollowUser, error)

func (*IGDownloadManager) GetSelfFollowing

func (m *IGDownloadManager) GetSelfFollowing() ([]instago.IGFollowUser, error)

func (*IGDownloadManager) GetSelfId

func (m *IGDownloadManager) GetSelfId() string

func (*IGDownloadManager) GetUserInfo

func (m *IGDownloadManager) GetUserInfo(username string) (instago.UserInfo, error)

func (*IGDownloadManager) GetUserInfoEndPoint

func (m *IGDownloadManager) GetUserInfoEndPoint(id string) (instago.UserInfoEndPoint, error)

func (*IGDownloadManager) GetUserReelMedia

func (m *IGDownloadManager) GetUserReelMedia(id string) (instago.IGReelTray, error)

func (*IGDownloadManager) GetUserStory

func (m *IGDownloadManager) GetUserStory(id string) (instago.UserTray, error)

func (*IGDownloadManager) IdToUsername

func (m *IGDownloadManager) IdToUsername(id string) (username string, err error)

Given id, get username from mobile API endpoint

func (*IGDownloadManager) IsCleanAccountSet

func (m *IGDownloadManager) IsCleanAccountSet() bool

func (*IGDownloadManager) IsInCollection

func (m *IGDownloadManager) IsInCollection(item instago.IGItem, name string) bool

func (*IGDownloadManager) LoadCleanDownloadManager

func (m *IGDownloadManager) LoadCleanDownloadManager(authFilePath string) (err error)

Optional. Load another account which is not blocked by any other account.

func (*IGDownloadManager) LoadCollectionList

func (m *IGDownloadManager) LoadCollectionList() (err error)

func (*IGDownloadManager) LoadIdUsernameFromDataDir

func (m *IGDownloadManager) LoadIdUsernameFromDataDir() (err error)

func (*IGDownloadManager) ProcessSavedItems

func (m *IGDownloadManager) ProcessSavedItems(items []instago.IGItem, downloadStory bool, c chan instago.IGItem)

func (*IGDownloadManager) ReDownload

func (m *IGDownloadManager) ReDownload(path string, info os.FileInfo) (err error)

func (*IGDownloadManager) SaveSelfFollow

func (m *IGDownloadManager) SaveSelfFollow() (err error)

Run SaveSelfFollowers and SaveSelfFollowing in oneshot

func (*IGDownloadManager) SaveSelfFollowers

func (m *IGDownloadManager) SaveSelfFollowers(filepath string) (err error)

func (*IGDownloadManager) SaveSelfFollowing

func (m *IGDownloadManager) SaveSelfFollowing(filepath string) (err error)

func (*IGDownloadManager) SmartDownloadAllPosts

func (m *IGDownloadManager) SmartDownloadAllPosts(item instago.IGItem) (err error)

func (*IGDownloadManager) SmartDownloadHighlights

func (m *IGDownloadManager) SmartDownloadHighlights(item instago.IGItem) (err error)

func (*IGDownloadManager) SmartDownloadPost

func (m *IGDownloadManager) SmartDownloadPost(item instago.IGItem) (isDownloaded bool, err error)

func (*IGDownloadManager) SmartDownloadStory

func (m *IGDownloadManager) SmartDownloadStory(user instago.User) (err error)

func (*IGDownloadManager) SmartDownloadUserStoryPostliveLayer

func (m *IGDownloadManager) SmartDownloadUserStoryPostliveLayer(user instago.User, layer int) (err error)

func (*IGDownloadManager) SmartGetUserInfoEndPoint

func (m *IGDownloadManager) SmartGetUserInfoEndPoint(id string) (instago.UserInfoEndPoint, error)

func (*IGDownloadManager) SmartGetUserStory

func (m *IGDownloadManager) SmartGetUserStory(user instago.User) (instago.UserTray, error)

func (*IGDownloadManager) TrayDownloader

func (m *IGDownloadManager) TrayDownloader(c chan TrayInfo, tl *TimeLimiter, ignorePrivateUser, ignoreReelMentionsIfStoryItemExist, ignorePrivateReelMention, verbose bool)

func (*IGDownloadManager) TrayDownloader2ChanPrivate

func (m *IGDownloadManager) TrayDownloader2ChanPrivate(cPublicUser, cPrivateUser chan TrayInfo, tl *TimeLimiter, ignorePrivate, verbose bool)

func (*IGDownloadManager) TrayDownloaderViaStoryAPI

func (m *IGDownloadManager) TrayDownloaderViaStoryAPI(c chan TrayInfo, tl *TimeLimiter, stackMode, ignorePrivateReelMention, verbose bool)

func (*IGDownloadManager) TwoAccountDownloadStoryForeverSecondAccountViaStoryAPI

func (m *IGDownloadManager) TwoAccountDownloadStoryForeverSecondAccountViaStoryAPI(interval1 int, interval2, interval3 int64, ignoreMuted, verbose bool)

Under test.

func (*IGDownloadManager) UsernameToId

func (m *IGDownloadManager) UsernameToId(username string) (id string, err error)

func (*IGDownloadManager) UsernameToUser

func (m *IGDownloadManager) UsernameToUser(username string) (user instago.User, err error)

func (*IGDownloadManager) UsernameToUserFromLocalData

func (m *IGDownloadManager) UsernameToUserFromLocalData(username string) (user instago.User, err error)

type TimeLimiter

type TimeLimiter struct {
	LastTime time.Time
	Interval int64 // unit: second
}

func NewTimeLimiter

func NewTimeLimiter(interval int64) *TimeLimiter

func (*TimeLimiter) IsOverNIntervalAfterLastTime

func (tl *TimeLimiter) IsOverNIntervalAfterLastTime(n int64) bool

func (*TimeLimiter) SetLastTimeToNow

func (tl *TimeLimiter) SetLastTimeToNow()

func (*TimeLimiter) WaitAtLeastIntervalAfterLastTime

func (tl *TimeLimiter) WaitAtLeastIntervalAfterLastTime()

func (*TimeLimiter) WaitAtLeastNIntervalAfterLastTime

func (tl *TimeLimiter) WaitAtLeastNIntervalAfterLastTime(n int64)

type TrayInfo

type TrayInfo struct {
	Id              int64
	Username        string
	Layer           int64
	IsPrivate       bool
	LatestReelMedia int64
}

func GetTrayInfoFromQueue

func GetTrayInfoFromQueue(queue []TrayInfo, id int64) (ti TrayInfo, ok bool)

func SetupTrayInfo

func SetupTrayInfo(id int64, username string, layer int64, isPrivate bool, latestReelMedia int64) (ti TrayInfo)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL