-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
49 lines (31 loc) · 1.43 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
output: rmarkdown::github_document
---
# cfhttr
Workaround Cloudflare Anti-DDoS Protection
## Description
Some sites use Cloudflare's anti-DDoS protection to, well, avoid being DDoS'd.
However, many of these sites also host files that they intended for automated download workflows and often forget to exclude those from the heavy-handed anti-DDoS, javascript + human-required settings.
Cloudflare employs a few different anti-DDoS protection schemes. One involves a 503 HTTP response followed by the submission of a "challenge" that was solved via a bit of javascript on the page. _That's what this pacakge handles._ If you encounter other Cloudflare anti-DDoS protection schemes (especially the captcha one), then this won't work.
## NOTE
If this ceases to work it likely means that Cloudflare changed the challenge code. Please [file an issue](https://github.com/hrbrmstr/cfhttr/issues) so I can redo the workaround.
## What's Inside The Tin
The following functions are implemented:
- `cf_GET`: Cloudflare bypass version of `httr::GET()`
## Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/cfhttr")
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```
## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
library(cfhttr)
# current verison
packageVersion("cfhttr")
```
```{r}
res <- cf_GET("https://www.bitmarket.pl/graphs/BTCPLN/90m.json")
str(httr::content(res, as="parsed"))
```