I'm trying to extract all comments from a list of youtube videos using the tuber package
I can extract comments from a single video ID using the following code:
library(tuber)client_id <- [my_client_id]client_secret <- [my_client_secret]yt_oauth(app_id = client_id, app_secret = client_secret, token = "")video_id <- "arjHXHHQkQs"test_comments <- get_all_comments(video_id = video_id)I have a vector of 29 youtube IDs and I'm trying to use the map_df() function to iterate over every ID in the vector and apply the function get_all_comments() but I keep getting an error:
id <- c("C5OLDKq_CfI", "Y26MWDh8u3Y", "0HQyjY8I830", "AGBX-AHKDfk" ,"YuA59DKabVs") comments_getter <- function(id) { tuber::get_all_comments(video_id = id)}comments_raw <- purrr::map(.x = id, .f = comments_getter)Error: HTTP failure: 401Called from: tuber_check(req)And from the debug viewer I get this
function (req) { if (req$status_code < 400) return(invisible()) stop("HTTP failure: ", req$status_code, "\n", call. = FALSE)}Is something related to a limit for the API or is there an error in my code?