tt_videos_hidden(
video_urls,
save_video = TRUE,
overwrite = FALSE,
dir = ".",
cache_dir = NULL,
sleep_pool = 1:10,
max_tries = 5L,
cookiefile = NULL,
verbose = interactive(),
...
)tt_videos(...)
a data.frame containing post metadata.
vector of URLs or IDs to TikTok videos.
logical. Should the videos be downloaded.
logical. If save_video=TRUE and the file already exists, should it be overwritten?
directory to save videos files to.
if set to a path, one RDS file with metadata will be written to disk for each video. This is useful if you have many videos and want to pick up where you left if something goes wrong.
a vector of numbers from which a waiting period is randomly drawn.
how often to retry if a request fails.
path to your cookiefile. Usually not needed after running
auth_hidden once. See vignette("unofficial-api", package =
"traktok") for more information on authentication.
should the function print status updates to the screen?
handed to tt_videos_hidden (for tt_videos) and (further) to
tt_request_hidden.
The function will wait between scraping two videos to make it less
obvious that a scraper is accessing the site. The period is drawn randomly
from the sleep_pool and multiplied by a random fraction.
Note that the video file has to be requested in the same session as the metadata. So while the URL to the video file is included in the metadata, this link will not work in most cases.
if (FALSE) {
tt_videos("https://www.tiktok.com/@tiktok/video/7106594312292453675")
}
Run the code above in your browser using DataLab