datadome

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseChallengeScriptURL

func ParseChallengeScriptURL(html string) (string, bool)

ParseChallengeScriptURL reports the challenge bundle a device check or captcha page loads with a <script defer src="..."> tag, and whether the page uses one at all.

DataDome serves some challenge pages with the bundle inlined in the HTML and others with it in its own file, switching between the two per request, so this has to be checked on every challenge rather than configured once.

When it reports true, GET the returned URL with the same client, proxy and headers you used for the challenge page, and pass the response body as the Script field of DataDomeInterstitialInput or DataDomeSliderInput. When it reports false the bundle is already in the HTML and Script stays empty.

deviceLink, err := datadome.ParseInterstitialDeviceCheckLink(body, cookie, referer)
// ... GET deviceLink, read the body into html ...

var script string
if scriptURL, ok := datadome.ParseChallengeScriptURL(html); ok {
    // fetch scriptURL with your own client, read the body into script
}

payload, headers, err := session.GenerateDataDomeInterstitial(ctx, &hyper.DataDomeInterstitialInput{
    UserAgent:      userAgent,
    DeviceLink:     deviceLink,
    Html:           html,
    Script:         script,
    AcceptLanguage: acceptLanguage,
    IP:             ip,
})
func ParseInterstitialDeviceCheckLink(body io.Reader, datadomeCookie, referer string) (string, error)

ParseInterstitialDeviceCheckLink parses the device check url (/interstitial/?initialCid...) from a blocked response body

the datadome cookie is the current value of the 'datadome' cookie

func ParseSliderDeviceCheckLink(body io.Reader, datadomeCookie, referer string) (string, error)

ParseSliderDeviceCheckLink parses the device check url (/captcha/?initialCid...) from a blocked response body

the datadome cookie is the current value of the 'datadome' cookie

Types

This section is empty.

Jump to

Keyboard shortcuts

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