This is a generic function to download captchas from any
webssite given a captcha's URL. download_captcha_*() are aliases for
some known captchas of public services in Brazil.
download_captcha(
url,
n = 1,
path = ".",
secure = FALSE,
timeout = 3,
ext = ".jpeg"
)URL from which to download captcha or the name of a known source
("tjrs", "tjmg", "tjrj", "trt" or "rfb")
Total number of captchas to download
Folder where to save downloaded captchas
Whether or not to use ssl_verifypeer = TRUE (see
httr::GET())
Timeout for captcha download (passed on to httr::timeout())
Default image extension if not able to extract it automatically
A vector with the paths to the downloaded files
All downloads have a timeout of three seconds to run.
If the website you are accessing blocks IP after multiple calls, consider
creating a loop an using base::Sys.sleep() to wait for new calls.