Skip to content

siongui/tiktokgo

Repository files navigation

tiktokgo

https://goreportcard.com/badge/github.com/siongui/tiktokgo

tiktokgo downloads user avatar photo and videos.

Currently this package can

  • download user avatar photos and latest 5 video items (with watermark) without login if the user account is not private.
  • download video item (with watermark) by the item URL.

Visit example directory for examples.

Tested on:

Important Tricks

According to README in drawrowfly/tiktok-scraper, the video play/download address is binded to the tt_webid_v2 cookie value. To download the video successfully, the same headers/cookies must be used both when access API or metadata and when access/download videos. The following three are necessary part (values copied from README in drawrowfly/tiktok-scraper for illustration purpose):

headers: {
  "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36",
  "referer": "https://www.tiktok.com/",
  "cookie": "tt_webid_v2=689854141086886123"
},

UNLICENSE

Released in public domain. See UNLICENSE.

References

[1]