download_captcha: Download captchas from a URL

Description Usage Arguments Value IP blocking

View source: R/download.R

Description

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.

Usage

1
2
3
4
5
6
7
8
download_captcha(
  url,
  n = 1,
  path = ".",
  secure = FALSE,
  timeout = 3,
  ext = ".jpeg"
)

Arguments

url

URL from which to download captcha or the name of a known source ("tjrs", "tjmg", "tjrj", "trt" or "rfb")

n

Total number of captchas to download

path

Folder where to save downloaded captchas

secure

Whether or not to use ssl_verifypeer = TRUE (see httr::GET())

timeout

Timeout for captcha download (passed on to httr::timeout())

ext

Default image extension if not able to extract it automatically

Value

A vector with the paths to the downloaded files

IP blocking

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.


decryptr/decryptr documentation built on Nov. 29, 2020, 11:14 p.m.