googleapis / googleapis/google-api-nodejs-client

how can upload the video on youtube without fs.creatReadStream() in node js?

Aperta
#3,033 1 commento 1 reazione 0 assegnatari Vedi su GitHub
priority: p3 type: question
Lingua principale
TypeScript
Stelle
12.2k
Fork
2k
Merge medio
1g 9h
PR unite (30g)
24

Descrizione

Hi, community,
I use node js and google API NPM with both I want to upload a video on the user's youtube account but I couldn't figure out how to pass the request.file into the insert function of the package, I know that for local files i have to use fs.createReadStream() but for request.file I can not use that so how can I pass video file data to youtube api?

I tried with some thing buffer but not working:-
service.videos.insert(
{
auth: oauth2Client,
part: "snippet,status",
requestBody: {
snippet: {
title: "Xyz2",
description: "abc",
categoryId: 28,
defaultAudioLanguage: "en",
defaultLanguage: "en",
},
status: {
privacyStatus: "public",
},
},
media: {
mimeType:"video/*",
body: Buffer.from(req.files.video),

},
},
(err, response) => {
console.log('response: ', response);
if (err) {
console.log(err);
}
// fs.unlink(`${req.files.video.name.replace(/ /g, '')}`)
var subscribers = response.data.items;
console.log(subscribers);
res.send({ subscribers });
}
);

Not working
Please help,thank you

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue mentions service.videos.insert, its media.body argument, and req.files.video, but names no repository file or test. Start by reviewing the client library's upload handling for service.videos.insert and reproduce the shown request with the provided file object. Done should be a verified, documented upload path or a clearly identified client limitation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
node.js
Ambito
api, backend
Tipo di issue
Documentazione
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.