Estoy tratando de usar Google Drive API v3 para obtener un blob de archivos y luego subirlo al almacenamiento de Firebase.
drive.files.get({ fileId: fileId, alt: 'media', }, {responseType: 'blob'}) .then(response => { console.log(response.data); const file = response.data const storage = getStorage(); const storageRef = ref(storage, 'testvideo.mp4'); // 'file' comes from the Blob or File API uploadBytes(storageRef, file).then((snapshot) => { console.log('Uploaded a blob!'); }); }) .catch(err=>{ console.log(err); }); // console.log(response.data) output Blob { [Symbol(type)]: 'video/mp4', [Symbol(buffer)]: <Buffer 00 00 00 18 66 74 79 70 6d 70 34 32 00 00 00 00 69 73 6f 6d 6d 70 34 32 00 00 00 88 66 72 65 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 20233366 more bytes> } Tengo problemas para tomar el blob en json y usarlo en nodejs y obtengo este error en uploadBytes(storageRef, file) .
TypeError: Cannot read properties of undefined (reading 'byteLength') porque solo result.data no es un blob válido. Esencialmente, estoy tratando de descubrir cómo configurar
const file = new Blob([response.data.buffer], {type: response.data.type});