mirror of
https://github.com/pikami/tiktok-dl.git
synced 2026-01-29 06:32:55 +00:00
Added ability to download single videos
This commit is contained in:
@@ -23,7 +23,7 @@ func GetUserUploads(username string) []models.Upload {
|
||||
opts := append(chromedp.DefaultExecAllocatorOptions[:],
|
||||
chromedp.DisableGPU,
|
||||
chromedp.UserDataDir(dir),
|
||||
chromedp.Flag("headless", models.Config.UserName),
|
||||
chromedp.Flag("headless", !models.Config.Debug),
|
||||
)
|
||||
|
||||
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
|
||||
@@ -43,7 +43,8 @@ func GetUserUploads(username string) []models.Upload {
|
||||
// Navigate to user's page
|
||||
chromedp.Navigate(`https://www.tiktok.com/@`+username),
|
||||
// Execute url grabber script
|
||||
chromedp.EvaluateAsDevTools(utils.ReadFileAsString("getVidLinks.js"), &jsOutput),
|
||||
chromedp.EvaluateAsDevTools(utils.ReadFileAsString("scraper.js"), &jsOutput),
|
||||
chromedp.EvaluateAsDevTools("bootstrapIteratingVideos()", &jsOutput),
|
||||
// Wait until custom js finishes
|
||||
chromedp.WaitVisible(`video_urls`),
|
||||
// Grab url links from our element
|
||||
|
||||
Reference in New Issue
Block a user