Skip to contents

This function downloads full-sized or thumbnail images and media files using information from atlas_media to a local directory.

Usage

collect_media(df, thumbnail = FALSE, path)

Arguments

df

tibble: returned by atlas_media() or a pipe starting with request_data(type = "media").

thumbnail

logical: If TRUE will download small thumbnail-sized images, rather than full size images (default).

path

string: [Deprecated] Use galah_config(directory = "path-to-directory)" instead. Supply a path to a local folder/directory where downloaded media will be saved to.

Value

Invisibly returns a tibble listing the number of files downloaded, grouped by their HTML status codes. Primarily called for the side effect of downloading available image & media files to a user local directory.

Examples

if (FALSE) {
# Use `atlas_media()` to return a `tibble` of records that contain media
x <- galah_call() |> 
  galah_identify("perameles") |>
  galah_filter(year == 2015) |>
  atlas_media()

# To download media files, add `collect_media()` to the end of a query 
galah_config(directory = "media_files")
collect_media(x)
}