tthtml

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package tthtml pulls a named <script> JSON blob out of a TikTok web page. The page ships its state in <script id="..." type="application/json">...</script> tags; this package finds one by id and returns its raw JSON bytes.

Index

Constants

View Source
const UniversalDataID = "__UNIVERSAL_DATA_FOR_REHYDRATION__"

UniversalDataID is the id of the rehydration blob every modern TikTok page carries.

Variables

View Source
var ErrNotFound = errors.New("script blob not found")

ErrNotFound means the page did not contain a script with the requested id.

Functions

func IsWAFChallenge

func IsWAFChallenge(html string) bool

IsWAFChallenge reports whether a page body is the SlardarWAF "Please wait" challenge stub rather than real content. The stub is short and carries the challenge markers.

func ScriptJSON

func ScriptJSON(html, id string) (string, error)

ScriptJSON returns the raw JSON text inside <script id="{id}" ...>...</script>. It scans the markup directly, which is cheaper and more forgiving than a full HTML parse for a single well known tag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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