An open API service indexing awesome lists of open source software.

https://github.com/koderkow/ttvcollections

Download Twitch Highlights
https://github.com/koderkow/ttvcollections

Last synced: 2 months ago
JSON representation

Download Twitch Highlights

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# ttvCollections

The goal of ttvCollections is to download our highlights! This may turn into a separate package focusing on being a R wrapper for the Twitch API.

## Installation

- Make sure [youtube-dl](http://ytdl-org.github.io/youtube-dl/) is installed
- Download from here with `remotes::install_github("koderkow/ttvCollections")`

## Envirnment Variables

There are three environment variables that are default values to function parameters. Set in .Renviron with `usethis::edit_r_environ()`.

- TWITCH_CLIENT_ID
- TWITCH_SECRET
- TWITCH_USER_ID

## Sample code

### Auth

```{r}
library(ttvCollections)

twitch_auth()
```

### Extract Highlights

```{r}
d <- get_hightlights()

d
```

### Download a Hightlight

```{r}
urls <- d$url

download_video(urls[5], "sample-prefix")
```