ropensci / piggyback

:package: for using large(r) data files on GitHub
https://docs.ropensci.org/piggyback
GNU General Public License v3.0
185 stars 26 forks source link

pb_download_url should accept a parameter to return either the `browser_download_url` or the `api_download_url` #116

Closed tanho63 closed 9 months ago

tanho63 commented 9 months ago

pb_download_url() returns a url for downloading release files, but it is not useful for private repositories since there is no way to pass the authorization through via curl/httr

httr::GET(
    "https://github.com/tanho63/piggyback-private/releases/download/v1.0.0/iris_example.csv",
    httr::add_headers("Authorization", paste("Bearer",gh::gh_token()))
)
#> 404 error

To make this more useful, we should add a parameter to pb_download_url that allow users to retrieve the correct api_download_url instead, so that they can make their own curl queries or otherwise