Documentation
¶
Overview ¶
This code is borrowed from this repository with small changes https://github.com/omegaatt36/instagramrobot
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractShortcodeFromLink ¶
ExtractShortcodeFromLink will extract the media shortcode from a URL link or path
Types ¶
type APIFetcher ¶ added in v0.5.0
type APIFetcher struct{}
APIFetcher is the legacy implementation that talks to Instagram's GraphQL / embed endpoints over plain HTTP. It is kept behind the Fetcher interface as a fallback; note that Instagram increasingly serves anti-bot challenges (error 1357054) to these anonymous requests, especially from datacenter IPs.
func NewAPIFetcher ¶ added in v0.5.0
func NewAPIFetcher() *APIFetcher
NewAPIFetcher creates the legacy HTTP-based fetcher.
type BrowserFetcher ¶ added in v0.5.0
type BrowserFetcher struct {
// contains filtered or unexported fields
}
BrowserFetcher retrieves posts by loading the post page in a real (headless) browser via the shared browser.Manager. Because the requests originate from a genuine browser, Instagram's anti-bot layer serves the actual post instead of a challenge page — which is why this works where APIFetcher gets error 1357054. The media URLs are read from the page's embedded JSON; no cookies/tokens are needed.
func NewBrowserFetcher ¶ added in v0.5.0
func NewBrowserFetcher() *BrowserFetcher
NewBrowserFetcher creates a browser-based fetcher using the shared browser.
func (*BrowserFetcher) GetPost ¶ added in v0.5.0
GetPost implements Fetcher by loading the post page in a real browser and parsing the embedded media JSON. The "/p/" path serves both single posts and reels (Instagram resolves the media by shortcode regardless of the path segment), and also carousels and photos.