Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Error when uploading a thumbnail via youtube API with R

$
0
0

I want to use R to update thumbnails of my youtube videos.I'm following the google documentation, but I get the following error:

"The request does not include the image content."

The curent status of my code is the following:

library(httr)library(tuber)video.id <- [ID]thumbnail.path <- [path]youtube.client.id <- [ID]youtube.client.secret <- [secret]yt_oauth(    app_id = youtube.client.id,    app_secret = youtube.client.secret,    scope = 'partner')req <- POST("https://www.googleapis.com",    path = paste0("youtube/v3/thumbnails/set","?videoId=", video.id    ),    body = httr::upload_file(thumbnail.path),    config(token = getOption("google_token")))

I have similar queries for other API call (using PUT or GET), and they work.I think the issue is around the upload_file, but cannot find what should be the solution.

How can I fix that?Thanks in advance


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>