Skip to content

Commit

Permalink
fix solve_captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGruber committed Jun 4, 2024
1 parent a8f6409 commit 6497ecc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: traktok
Type: Package
Title: Collecting TikTok Data
Version: 0.0.4.9000
Version: 0.0.5.9000
Authors@R:
person(given = "Johannes B.",
family = "Gruber",
Expand Down
8 changes: 6 additions & 2 deletions R/api_hidden.r
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,11 @@ tt_user_videos_hidden <- function(username,

solve_captcha <- function(sess) {
captcha <- rvest::html_element(sess, "#captcha-verify-image")
if (length(captcha) == 0L) return(TRUE)
sess$view()
if (length(captcha) == 0L) {
the$view <- NULL
return(TRUE)
}
if (is.null(the$view))
the$view <- sess$view()
solve_captcha(sess)
}

0 comments on commit 6497ecc

Please sign in to comment.